Skip to content

Commit

Permalink
Fix Global off blocks lights turning on (openhab#11797)
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Skinner <[email protected]>
  • Loading branch information
Skinah authored and andan67 committed Nov 5, 2022
1 parent 92fad36 commit 6708c90
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ public void handleCommand(ChannelUID channelUID, Command command) {
break;
case CHANNEL_MASTER_CONTROLS:
if (command instanceof OnOffType) {
if (OnOffType.ON.equals(command)) {
// global may be off, but we don't want to switch global off and affect other segments
localApi.setGlobalOn(true);
}
localApi.setMasterOn(OnOffType.ON.equals(command), config.segmentIndex);
} else if (command instanceof IncreaseDecreaseType) {
if (IncreaseDecreaseType.INCREASE.equals(command)) {
Expand All @@ -159,6 +163,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
localApi.setMasterOn(false, config.segmentIndex);
return;
}
localApi.setGlobalOn(true);
primaryColor = (HSBType) command;
if (primaryColor.getSaturation().intValue() < config.saturationThreshold && hasWhite) {
localApi.setWhiteOnly((PercentType) command, config.segmentIndex);
Expand Down

0 comments on commit 6708c90

Please sign in to comment.