basnijholt / adaptive-lighting

Adaptive Lighting custom component for Home Assistant
https://basnijholt.github.io/adaptive-lighting/
Apache License 2.0
1.71k stars 127 forks source link

Pls add a new service to TOGGLE manual mode for an entity (ie if off make on, if on make off) #910

Open ncd7 opened 5 months ago

ncd7 commented 5 months ago

Currently we have a SET service which requires you to specify true or false whether you want to enable manual control or not. If one wants to implement a button that 'toggles' manual control, you need to (1) enable attributes in switch sensor (2) parse the manual control to figure out if a room is manually controlled (3) set the boolean in the service call appropriately.

If we had a toggle service, we could avoid all of this and simply invoke it. I assume it's fairly trivial to implement based on the existing SET service so I'm marking this as an enhancement rather than a new feature.

Thank you for this wonderful integration!

th3w1zard1 commented 4 months ago

FWIW this can already be done with an automation by parsing the integration entity's details. But I see the value of having an api call available.

ncd7 commented 3 months ago

Correct, as I described above, it is not hard to add it myself but I think it would be useful as right now it requires a bit of parsing. It's just a convenience feature though so I doubt it's worth spending too much time on it.