Skip to content

Conversation

@AlCalzone
Copy link
Contributor

This is necessary to be able to handle the inclusion state changed event, which is currently being ignored by HA, leading to a discrepancy between the assumed and actual inclusion state.

I'm not sure if this is the right approach. Ideally I'd like a method to update any property, not just the inclusion state, so we don't have to add another when we need to selectively update a different property in the future.

@MartinHjelmare MartinHjelmare changed the title feat: add method to update the controller's inclusion state Add method to update the controller's inclusion state Feb 18, 2025
self.data["rebuildRoutesProgress"]
)

def update_inclusion_state(self, state: InclusionState) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the event handler handle_inclusion_state_changed instead.

Each incoming event should have a corresponding event handler in the appropriate model. The event handler should update state as needed before emitting the event, calling event listeners of the event. This is how the library is designed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlCalzone
Copy link
Contributor Author

Closing in favor of #1173. That makes more sense.

@AlCalzone AlCalzone closed this Feb 18, 2025
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.

3 participants