Skip to content

Merge info_object into state and emit state change diffs#804

Draft
puddly wants to merge 9 commits into
zigpy:devfrom
puddly:puddly/zha-entity-state-consolidation
Draft

Merge info_object into state and emit state change diffs#804
puddly wants to merge 9 commits into
zigpy:devfrom
puddly:puddly/zha-entity-state-consolidation

Conversation

@puddly

@puddly puddly commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This PR replaces the state dict with a strongly typed dataclass that absorbs info_object. We now also emit state change diffs in EntityStateChangedEvent's new state_diff attribute.

For stronger typing and to support the client/server architecture split in the future, we benefit from having more centralized state for entities. This will allow us to send batched state updates to the client instead of the client being notified of a general "update" and then reaching for the state dict of the ZHA entity.

The HA Core half is here: home-assistant/core@dev...puddly:core:puddly/zha-state-migration. It uses the state_diff values and also adds dynamic capability recomputation.


Part of OpenHomeFoundation/roadmap#93 and a continuation of #663.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant