home-assistant / architecture

Repo to discuss Home Assistant architecture
310 stars 101 forks source link

Add feature light distribution control to LightEntity #703

Closed sMauldaeschle closed 2 years ago

sMauldaeschle commented 2 years ago

Context

Some light fixtures are able to emit light in opposite directions (e.g. up and down). It is physically one light fixture but has more than one actual light sources that allow transitions and mixtures of up and down light for instance.

A big technology provider is Casambi whose various smart devices and chips get integrate in divers light fixture from various light manufacturers. Example products can be found from Occhio, e.g. Sento. Another example with up/down lightning is Philips Hue Ensis). Here I did not find any information if they already support the transition.

Home Assistant and the LightEntity currently is not able to handle this feature, why I suggest to add it.

Proposal

Add new feature to support light distribution control. This change adds the attribute ATTR_DISTRIBUTION, extends the LightEntity class with the member _attr_distribution, updates the schemas and adds the corresponding function def distribution(self). The turn_on and toggle services are extend by another field distribution.

Since I did not know of the architectural discussions here, PRs already exist: PR for the code changes: https://github.com/home-assistant/core/pull/63629 PR for the documentation update: https://github.com/home-assistant/home-assistant.io/pull/21088 Open work from my perspective: Include a conditional slider in the more-info dialogue to adjust the distribution in the same way as brightness.

I hope this is in line with the architectural thoughts for the LightEntity. Happy to hear your feedback and suggestions. If anybody is interested in testing: The home_assistant_casambi component and its aiocasambi library have been updated by me already. The feature is functional.

Consequences

New light feature can be fully controlled from HA.