Just always use the brightness command for turning on the light
This commit is contained in:
parent
00242e16ad
commit
4a53489003
1 changed files with 1 additions and 10 deletions
|
|
@ -13,16 +13,7 @@ let internal tryFindLight friendlyName =
|
|||
|
||||
let internal generateZigbeeCommandsToFixLight (light: Light) (desiredLightState: LightState) =
|
||||
seq {
|
||||
let isRemoteControlled =
|
||||
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
|
||||
if desiredLightState.State = Off then
|
||||
yield generateStateCommand desiredLightState.State light
|
||||
|
||||
if desiredLightState.State = On then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue