mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[intesis] Correctly handles empty enum message (#20401)
Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
This commit is contained in:
+3
@@ -64,6 +64,9 @@ public class IntesisBoxMessage {
|
||||
}
|
||||
|
||||
public List<String> getLimitsValue() {
|
||||
if (value.length() <= 2) {
|
||||
return List.of();
|
||||
}
|
||||
return Arrays.asList(value.substring(1, value.length() - 1).split(","));
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -297,7 +297,7 @@ public class IntesisBoxHandler extends BaseThingHandler implements IntesisBoxCha
|
||||
logger.trace("Property target temperatures {} added", message.getValue());
|
||||
properties.put("targetTemperature limits", "[" + minTemp + "," + maxTemp + "]");
|
||||
addChannel(CHANNEL_TYPE_TARGETTEMP, "Number:Temperature");
|
||||
} else {
|
||||
} else if (message.getLimitsValue().size() > 0) {
|
||||
switch (function) {
|
||||
case "MODE":
|
||||
properties.put("supported modes", message.getValue());
|
||||
@@ -320,6 +320,9 @@ public class IntesisBoxHandler extends BaseThingHandler implements IntesisBoxCha
|
||||
addChannel(CHANNEL_TYPE_VANESLR, "String");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
logger.trace("Property {} limits {} not added (due to missing limits)", function,
|
||||
message.getValue());
|
||||
}
|
||||
updateProperties(properties);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user