Standardize the handling of entity attributes #680
-
ContextEntities can have attributes, while we try to reduce the general use of state attributes (as in most cases, they should have been separate entities anyways), there are still a lot of cases we have these attributes. The majority of our integrations currently implement the existing behavior with these attributes:
The problem with this approach, is that in both cases, the attribute is not provided; thus it is impossible to differentiate between: "Does not exist" vs "Does not have a value" Especially the case of "Does not have a value" is problematic, as this causes unexpected behavior when one is automating with these attributes or templates; They end up throwing errors/warnings about non-existing attributes when there is no value provided at that point in time. ProposalWe should prevent this unexpected behavior and reduce complexity in templates for these cases (as they now require additional checks). Additionally, add the possibility to distinguish between "does not exist" and "does not provide a value". Therefore, the following proposal to document as the official way to handle attributes:
Clarification about expected attributes (Added 2024-01-11)An attribute is expected if supported by the entity, for example as indicated by Consequences
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Sounds good. What about |
Beta Was this translation helpful? Give feedback.
-
It seems there's consensus about the proposal. Suggest to approve it. |
Beta Was this translation helpful? Give feedback.
It seems there's consensus about the proposal. Suggest to approve it.