diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift index 5484d214..1e610277 100644 --- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift +++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift @@ -13,5 +13,5 @@ import Foundation public class OpenHABCommandOptions: Decodable { public var command = "" - public var label = "" + public var label: String? = "" } diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift index 74cc3f29..2a07cb60 100644 --- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift +++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift @@ -121,7 +121,7 @@ public class OpenHABWidget: NSObject, MKAnnotation, Identifiable { public var mappingsOrItemOptions: [OpenHABWidgetMapping] { if mappings.isEmpty, let commandOptions = item?.commandDescription?.commandOptions { - commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label) } + 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) } } else { diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift index 348c1645..294c6518 100644 --- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift +++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift @@ -98,7 +98,7 @@ class ObservableOpenHABWidget: NSObject, MKAnnotation, Identifiable, ObservableO var mappingsOrItemOptions: [OpenHABWidgetMapping] { if mappings.isEmpty, let commandOptions = item?.commandDescription?.commandOptions { - commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label) } + 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) } } else {