From 6708c90b6a601c76acf083a9b95fec70af157b68 Mon Sep 17 00:00:00 2001 From: Matthew Skinner Date: Thu, 16 Dec 2021 18:58:51 +1100 Subject: [PATCH] Fix Global off blocks lights turning on (#11797) Signed-off-by: Matthew Skinner --- .../java/org/openhab/binding/wled/internal/WLedHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WLedHandler.java b/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WLedHandler.java index 9a77d7fddff01..c145f1c93f26c 100644 --- a/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WLedHandler.java +++ b/bundles/org.openhab.binding.wled/src/main/java/org/openhab/binding/wled/internal/WLedHandler.java @@ -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)) { @@ -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);