jheling / freeathome

Free@Home component for Home Assistant
114 stars 41 forks source link

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

Open Tho85 opened 1 year ago

Tho85 commented 1 year 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.

eyk107 commented 2 months ago

Is there any reason why the MR isn't accepted?

oliverlinsenmaier commented 2 months ago

Couldn't we add this optional? So that every user can get the preferred behavior...