Skip to content

Commit

Permalink
[mqtt.homie] Create PercentageValue only if attribute is settable (op…
Browse files Browse the repository at this point in the history
…enhab#7774)

Signed-off-by: Aitor Iturrioz <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
  • Loading branch information
bodiroga authored and DaanMeijer committed Sep 1, 2020
1 parent 478e653 commit 10697f2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 10697f2

Please sign in to comment.