[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 Jacob Laursen
parent 5f64b85c59
commit 4244d68200

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);
} }
} }