[insteon] Fix led command stack overflow error (#17977)

Signed-off-by: jsetton <jeremy.setton@gmail.com>
This commit is contained in:
Jeremy 2024-12-26 17:54:24 -05:00 committed by GitHub
parent c31bcb2026
commit bbdf3e3479
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1460,8 +1460,8 @@ public abstract class CommandHandler extends BaseFeatureHandler {
} }
private void setLEDOnOff(InsteonChannelConfiguration config, Command cmd) { private void setLEDOnOff(InsteonChannelConfiguration config, Command cmd) {
State state = getInsteonDevice().getFeatureState(FEATURE_LED_ON_OFF); DeviceFeature feature = getInsteonDevice().getFeature(FEATURE_LED_ON_OFF);
if (!((State) cmd).equals(state)) { if (feature != null) {
feature.handleCommand(config, cmd); feature.handleCommand(config, cmd);
} }
} }
@ -2187,8 +2187,8 @@ public abstract class CommandHandler extends BaseFeatureHandler {
} }
private void setLEDControl(InsteonChannelConfiguration config) { private void setLEDControl(InsteonChannelConfiguration config) {
State state = getInsteonModem().getFeatureState(FEATURE_LED_CONTROL); DeviceFeature feature = getInsteonModem().getFeature(FEATURE_LED_CONTROL);
if (!OnOffType.ON.equals(state)) { if (feature != null) {
feature.handleCommand(config, OnOffType.ON); feature.handleCommand(config, OnOffType.ON);
} }
} }