jheling / freeathome

Free@Home component for Home Assistant
103 stars 37 forks source link

Fix clicking relays when turning off lights that are already off #163

Open Tho85 opened 10 months ago

Tho85 commented 10 months ago

I have a scene that turns off all lights at night. I noticed that the in-wall relays click when I turn on this scene, even if the light has already been off. This will probably reduce the lifetime of the relays.

I fixed this by respecting the state monitored by the component, and only sending a turn on/off signal if the device is not yet on/off. Working good so far over the last months.