Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use custom homeAssistantBehavior for better state management #65

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

t0bst4r
Copy link
Owner

@t0bst4r t0bst4r commented Nov 4, 2024

No description provided.

@t0bst4r
Copy link
Owner Author

t0bst4r commented Nov 4, 2024

@Apollon77

Currently testing with a SwitchDevice leads to initialization errors due to null-pointer exceptions.
grafik

The state of the homeAssistantBehavior is not set.
Don't get confused by the message Cannot read properties of undefined (reading 'state'). This is referring to a nested property homeAssistantBehavior.state.entity.state (--> entity is not set).

When ignoring those errors with (obviously wrong) null-checks, the next error happens when calling endpoint.setStateOf(HomeAssistantBehavior, { entity: entity }) in MatterDevice.

grafik

@t0bst4r t0bst4r changed the title refactor: use custom homeAssistantBehavior for better state management draft: refactor: use custom homeAssistantBehavior for better state management Nov 4, 2024
@t0bst4r t0bst4r changed the title draft: refactor: use custom homeAssistantBehavior for better state management refactor: use custom homeAssistantBehavior for better state management Nov 5, 2024
@t0bst4r t0bst4r merged commit 6520413 into main Nov 5, 2024
1 check passed
@t0bst4r t0bst4r deleted the behavior branch November 5, 2024 14:51
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