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

Improved entity handling #57

Merged
merged 6 commits into from
Dec 28, 2024
Merged

Improved entity handling #57

merged 6 commits into from
Dec 28, 2024

Conversation

zehnm
Copy link
Contributor

@zehnm zehnm commented Dec 28, 2024

Improve entity handling with setting correct state, depending on Roon communication and zones availability. Relates to some issues described in #56:

  • Set entity state in command handler if Roon is not paired.
    Set the media-player entity to unavailable, if an entity command is received, but Roon is either not paired or no transport available.

    This makes the entity unavailable in the UI and prevents further command
    failures until Roon core becomes available again.

  • Handle Roon core pairing and unpairing events.
    Once the integration is no longer paired to the Roon core, we can't send transport commands anymore. Set the media-player entity states to unavailable to indicate the disconnection state in the UI and prevent sending further commands.

    For the pairing event we may not clear our zone information stored
    during setup. Also, prevent to dynamically add new zones. Adding or
    removing zones require to run the integration setup.

  • Enable and disable media-player entities if a Roon zone was removed or re-added again.

Other changes:

image

Set the media-player entity to unavailable, if an entity command is
received, but Roon is either not paired or no transport available.

This makes the entity unavailable in the UI and prevents further command
failures until Roon core becomes available again.
Once the integration is no longer paired to the Roon core,
we can't send transport commands anymore. Set the media-player entity
states to `unavailable` to indicate the disconnection state in the UI
and prevent sending further commands.

For the pairing event we may not clear our zone information stored
during setup. Also, prevent to dynamically add new zones. Adding or
removing zones require to run the integration setup.
@zehnm zehnm force-pushed the fix/entity-handling branch from 02f4de3 to 3d8b32f Compare December 28, 2024 15:09
Enable and disable media-player entities if a Roon zone was removed or
re-added again.
@zehnm zehnm force-pushed the fix/entity-handling branch from 3d8b32f to 67c2409 Compare December 28, 2024 15:10
@zehnm zehnm requested a review from martonborzak December 28, 2024 15:11
@zehnm zehnm marked this pull request as ready for review December 28, 2024 15:11
@zehnm zehnm merged commit 699a585 into main Dec 28, 2024
6 checks passed
@zehnm zehnm deleted the fix/entity-handling branch December 28, 2024 15:42
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.

Use debug module for logging
2 participants