Skip to content

force_update and limiting publicating to actual state changes. #351

@chrisgilldc

Description

@chrisgilldc

Is your feature request related to a problem? Please describe.
Only publish an update if the value of an object has actually changed. This allows objects to be updated simply in a loop without extra logic at every update point to check against the previous state.

Describe the solution you'd like
Objects should only publish their state if the state changes, IE: if a BinarySensor is True and it is again set to True, don't publish anything since the state didn't change. If it is True and is set False, publish that.
It seems this should already be the behavior since the EntityInfo object has a 'force_update' property, but that doesn't control this behavior. I'm not sure it does anything.

Describe alternatives you've considered
Check against the previous state by keeping previous sent states in a separate data structure.
A separate data structure is required because it does not appear the objects store the most recent value they sent.
I have something like this implemented already in my previous solution, where messages were all generated manually. I'd prefer not to do that since I'm moving to HMD to clean things up.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions