diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift index c98f5e1b..c4766ed8 100644 --- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift +++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift @@ -13,5 +13,5 @@ import Foundation public class OpenHABOptions: Decodable { public var value = "" - public var label = "" + public var label: String? } diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift index 028cd555..66488044 100644 --- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift +++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift @@ -119,7 +119,7 @@ public class OpenHABWidget: NSObject, MKAnnotation, Identifiable { if mappings.isEmpty, let commandOptions = item?.commandDescription?.commandOptions { commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label ?? "") } } else if mappings.isEmpty, let stateOptions = item?.stateDescription?.options { - stateOptions.map { OpenHABWidgetMapping(command: $0.value, label: $0.label) } + stateOptions.map { OpenHABWidgetMapping(command: $0.value, label: $0.label ?? "") } } else { mappings } diff --git a/openHABWatch/Model/ObservableOpenHABWidget.swift b/openHABWatch/Model/ObservableOpenHABWidget.swift index 051ea2e2..ee4c9b87 100644 --- a/openHABWatch/Model/ObservableOpenHABWidget.swift +++ b/openHABWatch/Model/ObservableOpenHABWidget.swift @@ -97,7 +97,7 @@ class ObservableOpenHABWidget: NSObject, MKAnnotation, Identifiable, ObservableO if mappings.isEmpty, let commandOptions = item?.commandDescription?.commandOptions { commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label ?? "") } } else if mappings.isEmpty, let stateOptions = item?.stateDescription?.options { - stateOptions.map { OpenHABWidgetMapping(command: $0.value, label: $0.label) } + stateOptions.map { OpenHABWidgetMapping(command: $0.value, label: $0.label ?? "") } } else { mappings }