Just always use the brightness command for turning on the light

This commit is contained in:
Sven van Heugten 2026-02-27 18:08:31 +01:00
parent 00242e16ad
commit 4a53489003

View file

@ -13,16 +13,7 @@ let internal tryFindLight friendlyName =
let internal generateZigbeeCommandsToFixLight (light: Light) (desiredLightState: LightState) = let internal generateZigbeeCommandsToFixLight (light: Light) (desiredLightState: LightState) =
seq { seq {
let isRemoteControlled = if desiredLightState.State = Off then
light = VardagsrumFonsterlampa || light = SovrumNattduksbordlampa
if not isRemoteControlled then
match desiredLightState.State with
| On -> ()
| Off -> failwith $"Unexpectly trying to turn off {light}. It's not remote-controlled."
else if desiredLightState.State = On && (lightProps light).Bulb = IkeaBulb then
() // Rely on the brightness command for turning it on
else
yield generateStateCommand desiredLightState.State light yield generateStateCommand desiredLightState.State light
if desiredLightState.State = On then if desiredLightState.State = On then