Fix Global off blocks lights turning on (#11797)
Signed-off-by: Matthew Skinner <matt@pcmus.com>
This commit is contained in:
parent
e54dec524b
commit
82df34131c
|
@ -139,6 +139,10 @@ public class WLedHandler extends BaseThingHandler {
|
||||||
break;
|
break;
|
||||||
case CHANNEL_MASTER_CONTROLS:
|
case CHANNEL_MASTER_CONTROLS:
|
||||||
if (command instanceof OnOffType) {
|
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);
|
localApi.setMasterOn(OnOffType.ON.equals(command), config.segmentIndex);
|
||||||
} else if (command instanceof IncreaseDecreaseType) {
|
} else if (command instanceof IncreaseDecreaseType) {
|
||||||
if (IncreaseDecreaseType.INCREASE.equals(command)) {
|
if (IncreaseDecreaseType.INCREASE.equals(command)) {
|
||||||
|
@ -159,6 +163,7 @@ public class WLedHandler extends BaseThingHandler {
|
||||||
localApi.setMasterOn(false, config.segmentIndex);
|
localApi.setMasterOn(false, config.segmentIndex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
localApi.setGlobalOn(true);
|
||||||
primaryColor = (HSBType) command;
|
primaryColor = (HSBType) command;
|
||||||
if (primaryColor.getSaturation().intValue() < config.saturationThreshold && hasWhite) {
|
if (primaryColor.getSaturation().intValue() < config.saturationThreshold && hasWhite) {
|
||||||
localApi.setWhiteOnly((PercentType) command, config.segmentIndex);
|
localApi.setWhiteOnly((PercentType) command, config.segmentIndex);
|
||||||
|
|
Loading…
Reference in New Issue