From e973eb262ff4692fb18f4bd7b50878cf7a5b5be2 Mon Sep 17 00:00:00 2001 From: Danny Baumann Date: Mon, 14 Aug 2023 15:00:53 +0200 Subject: [PATCH] Use number format pattern for formatting state for icon URL See #3404 Signed-off-by: Danny Baumann --- mobile/src/main/java/org/openhab/habdroid/model/IconResource.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/src/main/java/org/openhab/habdroid/model/IconResource.kt b/mobile/src/main/java/org/openhab/habdroid/model/IconResource.kt index 46ea652175..188137c757 100644 --- a/mobile/src/main/java/org/openhab/habdroid/model/IconResource.kt +++ b/mobile/src/main/java/org/openhab/habdroid/model/IconResource.kt @@ -136,7 +136,7 @@ internal fun String?.toOH2WidgetIconResource( } val itemState = item?.state - var iconState = state?.asString.orEmpty() + var iconState = if (state?.asNumber != null) state.asNumber.toString() else state?.asString.orEmpty() if (itemState != null && useState) { if (item.isOfTypeOrGroupType(Item.Type.Color)) { // For items that control a color item fetch the correct icon