Improve the source labels for MusicCast players#74954
Conversation
… using the source-name as well as the source label
… using the source-name as well as the source label
…istant into musiccast-source-labels
|
Hey there @vigonotion, mind taking a look at this pull request as it has been labeled with an integration ( |
So it is not a breaking change? |
It is a breaking change for those who use the current source e.g. as a trigger by using a template such as |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
KevinCathcart
left a comment
There was a problem hiding this comment.
These changes all make sense. The only complicated part is the source mapping property and that looks to handle all the edge cases.
The other changes are simple and pretty obviously correct.
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
I would still love to get this merged |
OzGav
left a comment
There was a problem hiding this comment.
This looks good with no previous objections from others I think it should be approved.
marcelveldt
left a comment
There was a problem hiding this comment.
Sorry for the late final review. We're really swamped with PR's and trying to catch up reviewing them.
Adding a small test for this logic would even be better but overall this PR looks solid to be merged.
Thanks!
Breaking change
If you have any automation depending on the
sourcestate attribute of the media player entity, you will have to update these, because we want to show more user friendly values such as "Net Radio" instead of net_radio. Calling theselect_sourceservice will still be possible using the old source names.Proposed change
In the MusicCast app and in the display of the devices, the network related sources are shown in a more user friendly way as the values, which are used in the API. With this PR we use these alternative labels. For devices supporting external sources such as HDMI sources, it is possible to rename these sources in the app. Because the user is completely free to label two sources in the same way, we ensure that the source labels do not conflict with other sources. If there are conflicts such as HDMI 1 and HDMI 2 both labeled with "Apple TV", we name one of the sources as "Apple TV (hdmi1)" and the other "Apple TV (hdmi2)". To enable users to write automations without having to care about the user defined source names, it is still possible to call the
select_sourceservice with the original source names.In my opinion, it would be best to edit the media_player entity structure and the frontend to show these user defined labels only in the frontend and work with the original unique API defined values for service calls and states. However there was not enough positive feedback for that in the architecture discussion, so we go this way.
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: