Closed micha91 closed 3 years ago
The default for MMP is that platforms do support the concept of a speaker group master and will use this.group[0]
(this.attr.group_members[0]
in media_players case) as the master entity.
For a custom integration that wants to use the base media_player.join/unjoin
services that does not support the group master concept, if this.attr.group_members[0]
doesn't match the entity for the card, the card stops working as expected.
One platform already overrides this https://github.com/kalkih/mini-media-player/blob/master/src/model.js#L213 setting but to allow platforms using these new services to work with MMP without modification, the supportsMaster()
check would be better as a card yaml configuration option like supports_group_master: bool
.
The default for MMP is that platforms do support the concept of a speaker group master and will use
this.group[0]
(this.attr.group_members[0]
in media_players case) as the master entity.For a custom integration that wants to use the base
media_player.join/unjoin
services that does not support the group master concept, ifthis.attr.group_members[0]
doesn't match the entity for the card, the card stops working as expected.One platform already overrides this https://github.com/kalkih/mini-media-player/blob/master/src/model.js#L213 setting but to allow platforms using these new services to work with MMP without modification, the
supportsMaster()
check would be better as a card yaml configuration option likesupports_group_master: bool
.
Good point, didn't think about that - I implemented it, but as I do not have any system that does not support masters, I can not check, whether it works as expected. But from what I can see, there is no difference between the devices of a group anymore when I set supports_master: true
in the speaker group section, so we should be all good.
Thanks, that's great.
Good idea with the configurable supports_master
config as well!
HA has defined a new service schema for join and unjoin in the media_player component. Future (official) integrations will use these services instead of implementing join/unjoin in their domain. To enable using these base services, the platform has to be set to media_player in the cards config, so that it offers full backward compatibility.
This was already requested in #519 and will also be needed in the future for other integrations (such as the rewritten official musiccast integration).