[intesis] Correctly handles empty enum message (#20401)

Signed-off-by: Jonathan Gilbert <jpg@trillica.com>
This commit is contained in:
Jonathan Gilbert
2026-03-21 13:10:55 +01:00
committed by GitHub
parent b3183e8248
commit 5a78f07bf1
2 changed files with 7 additions and 1 deletions
@@ -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(","));
}
@@ -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;