From 10697f2b112e607667c7662c44ca7cc083c4e101 Mon Sep 17 00:00:00 2001 From: Aitor Iturrioz Date: Sun, 24 May 2020 22:59:55 +0200 Subject: [PATCH] [mqtt.homie] Create PercentageValue only if attribute is settable (#7774) Signed-off-by: Aitor Iturrioz Signed-off-by: Daan Meijer --- .../openhab/binding/mqtt/homie/internal/homie300/Property.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java index c9abb46e83a2f..57bd027d12fd0 100644 --- a/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java +++ b/bundles/org.openhab.binding.mqtt.homie/src/main/java/org/openhab/binding/mqtt/homie/internal/homie300/Property.java @@ -194,7 +194,7 @@ public void createChannelFromAttribute() { if (step != null && !isDecimal && step.intValue() <= 0) { step = new BigDecimal(1); } - if (attributes.unit != null && attributes.unit.contains("%")) { + if (attributes.unit.contains("%") && attributes.settable) { value = new PercentageValue(min, max, step, null, null); } else { value = new NumberValue(min, max, step, attributes.unit);