architecture
architecture copied to clipboard
Allow entity Integrations to provide entity options
Context
This is closely related to #316, and I would consider implementing this before enforcing that one.
Integrations try to make their entities useful. This means that sometimes they add things in software that are integration specific. The problem with this is that they are one-off, generally YAML only and not consistent across integrations.
There are receivers that can go louder than the connected speakers can support. The media player entity could offer changing the min and max allowed volumes.
There are motion detectors that only send motion detected events. The binary sensor integration could allow configuring how long the timeout is before we consider there to be no motion anymore.
Proposal
This assumes that we can offer per-entity options, a feature that currently does not exist.
Allow entity integrations to offer per-entity options that enable specific features. These features will live on the base classes.
This doesn't mean that we would accept all features for the base class, we would still vet that this is a common enough feature that we would want to add this.
Some options could be available to all integrations that provide entities, like limiting volume. Others could be based on opt-in, like the binary sensor events. This one could require a further tailored base class.
Consequences
It offers a migration path for certain use cases of #316. It will allow simplifying existing integrations and it can simplify future additions. It will also allow more consistent behavior and a more consistent configuration experience across entities of the same domain.
One consequence can be that we get too many options and things get complicated. We need to ensure that we don't let this get out of control.