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
Yamaha musiccast grouping-services #51952
Conversation
…ayer entities of the same device.
…ception on client join. In most cases, it works nevertheless.
…ernal distribution changes for more reliability. Let clients display the media image of the master.
…uccessful client joins.
…be the more common approach.
Hey there @vigonotion, mind taking a look at this pull request as its been labeled with an integration ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I tested everything in my setup which is slightly different and it works fine
Co-authored-by: Tom Schneider <tom.schneider-github@sutomaji.net>
Co-authored-by: Tom Schneider <tom.schneider-github@sutomaji.net>
From what we can see, the error in the test is not related to our changes. Please correct me, if I am wrong and any action is necessary! |
@micha91 does this mean mini media player grouping isn't going to work out of the box? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice addition 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the comments in a new PR. Thanks!
|
||
Creates a new group if necessary. Used for join service. | ||
""" | ||
_LOGGER.info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the info logs in this PR should be at debug level.
return [ | ||
entity | ||
for entity in self.coordinator.entities | ||
if entity != self and isinstance(entity, MusicCastMediaPlayer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the entities in this platform are MusicCastMediaPlayer
instances. Why do we have the check for that?
If we are worried about mixing them with other platform entities: Entities are a platform concern. It's usually a bad pattern to store them centrally.
return | ||
|
||
# It is not possible to join a group hosted by zone2 from main zone. | ||
raise Exception("Can not join a zone other than main of the same device.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use a subclass of HomeAssistantError
.
_LOGGER.debug("%s client leave called", self.entity_id) | ||
if not force and ( | ||
self.source == ATTR_MAIN_SYNC | ||
or len( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Python we don't need to check the length of containers to check if they are not empty. It's enough to just do:
if container:
Please clean this up where we use len
.
Proposed change
As musiccast is a multi room audio system, the possibility of creating and changing groups is a major feature of the system.
This PR adds the possibility to do this using home assistant services and the implemented services are fully compatible to the mini-media-player.
The new services are based on #51561 by @vigonotion and @micha91.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: