Skip to content

Commit

Permalink
input hint is an optional widget attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Tassilo Karge <[email protected]>
  • Loading branch information
TAKeanice committed Nov 11, 2024
1 parent ea7aff2 commit 5da2080
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public class OpenHABWidget: NSObject, MKAnnotation, Identifiable {

extension OpenHABWidget {
// This is an ugly initializer
convenience init(widgetId: String, label: String, icon: String, type: WidgetType, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, inputHint: InputHint, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABSitemapPage?, mappings: [OpenHABWidgetMapping], widgets: [OpenHABWidget], visibility: Bool?, switchSupport: Bool?, forceAsItem: Bool?) {
convenience init(widgetId: String, label: String, icon: String, type: WidgetType, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, inputHint: InputHint?, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABSitemapPage?, mappings: [OpenHABWidgetMapping], widgets: [OpenHABWidget], visibility: Bool?, switchSupport: Bool?, forceAsItem: Bool?) {
self.init()
id = widgetId
self.widgetId = widgetId
Expand All @@ -240,7 +240,7 @@ extension OpenHABWidget {
self.state = state ?? ""
self.text = text ?? ""
self.legend = legend
self.inputHint = inputHint
self.inputHint = inputHint ?? .text
self.encoding = encoding ?? ""
self.item = item
self.linkedPage = linkedPage
Expand Down Expand Up @@ -278,7 +278,7 @@ public extension OpenHABWidget {
let state: String?
let text: String?
let legend: Bool?
let inputHint: InputHint
let inputHint: InputHint?
let encoding: String?
let groupType: String?
let item: OpenHABItem.CodingData?
Expand Down
6 changes: 3 additions & 3 deletions openHABWatch/Model/ObservableOpenHABWidget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class ObservableOpenHABWidget: NSObject, MKAnnotation, Identifiable, ObservableO

extension ObservableOpenHABWidget {
// This is an ugly initializer
convenience init(widgetId: String, label: String, icon: String, type: String, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, inputHint: InputHint, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABSitemapPage?, mappings: [OpenHABWidgetMapping], widgets: [ObservableOpenHABWidget], forceAsItem: Bool?) {
convenience init(widgetId: String, label: String, icon: String, type: String, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, inputHint: InputHint?, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABSitemapPage?, mappings: [OpenHABWidgetMapping], widgets: [ObservableOpenHABWidget], forceAsItem: Bool?) {
self.init()

id = widgetId
Expand Down Expand Up @@ -247,7 +247,7 @@ extension ObservableOpenHABWidget {
self.state = state ?? ""
self.text = text ?? ""
self.legend = legend
self.inputHint = inputHint
self.inputHint = inputHint ?? .text
self.encoding = encoding ?? ""
self.item = item
self.linkedPage = linkedPage
Expand Down Expand Up @@ -285,7 +285,7 @@ extension ObservableOpenHABWidget {
let state: String?
let text: String?
let legend: Bool?
let inputHint: InputHint
let inputHint: InputHint?
let encoding: String?
let groupType: String?
let item: OpenHABItem.CodingData?
Expand Down

0 comments on commit 5da2080

Please sign in to comment.