Skip to content

Conversation

karwosts
Copy link
Member

@karwosts karwosts commented Aug 15, 2025

Proposed change

Frontend for home-assistant/core#150721

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@github-actions github-actions bot added the Design Related to Home Assistant design gallery label Aug 15, 2025
@karwosts karwosts marked this pull request as ready for review August 15, 2025 16:46
@MartinHjelmare
Copy link
Member

Core PR is approved. Frontend/design/product should verify the change is wanted.

@@ -207,7 +221,8 @@ export class HaMediaSelector extends LitElement {
private _pickMedia() {
showMediaBrowserDialog(this, {
action: "pick",
entityId: this.value?.entity_id,
entityId:
this.value?.entity_id || ensureArray(this.context?.filter_entity)?.[0],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it weird we only take the first entity id here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, though I'm not sure what is the alternative?

I would hope if you're doing play_media with multiple entities in a single service call, they probably would all support the same content?

If it must change, I guess you can fallback to manual entry if there are multiple entities, though that feels like maybe an over-reaction.

Copy link
Member

@bramkragten bramkragten Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usecase I can think of is that you select an area as target, and then a random media player of that area will be the first entity. So it will base the available content on that entity... which is weird maybe. But selecting an area with multiple different type of media players as target is weird anyway probably 🤷‍♂️.

Not sure if I would expect to show only content available for all selected entities, or content available for any of the entities...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could have if the context has multiple entities, a dropdown listing those entities, and you pick one entity from the dropdown, and that is used for the media?

Most of the code for that should already be there...

Copy link
Member Author

@karwosts karwosts Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok that will look like:

No targets:
image

1 target:
image

2+ targets:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bramkragten bramkragten merged commit 673ca8b into home-assistant:dev Aug 27, 2025
15 checks passed
@karwosts karwosts deleted the fix-play-media branch August 27, 2025 12:49
"media_content_type": "Media content type"
"media_content_type": "Media content type",
"media_content_id_detail": "The ID of the content to play. Platform dependent.",
"media_content_type_detail": "The type of the content to play, such as image, music, tv show, video, episode, channel, or playlist."
Copy link
Contributor

@NoRi2909 NoRi2909 Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nitpick here: It should be "TV show" as we generally capitalize abbreviations.
(Lokalise flagged this making me aware of it)

Fix included in #26745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Design Related to Home Assistant design gallery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants