Skip to content

Add media browser to Yoto#172325

Merged
joostlek merged 7 commits into
devfrom
media_browser_yoto
Jun 1, 2026
Merged

Add media browser to Yoto#172325
joostlek merged 7 commits into
devfrom
media_browser_yoto

Conversation

@piitaya
Copy link
Copy Markdown
Member

@piitaya piitaya commented May 27, 2026

Proposed change

Needs #172753

Adds library browsing and targeted playback to the Yoto media player.

Users can open the media browser from a Yoto entity and navigate their card library. Cards expand into chapters, chapters into tracks, and any node can be played directly. The browser uses a yoto://card/<card_id>/<chapter_key>/<track_key> URI scheme, and play_media resolves the URI to the right play_card call. The card segment namespaces the identifier so groups can be added later without breaking existing URIs.

Two small UX choices keep the tree compact:

  • Single-chapter cards expand straight to their tracks, skipping a redundant submenu.
  • Single-track chapters aren't expandable; clicking plays the track directly.

Playing a chapter starts from its first track. Targeted plays (chapter or track) always start from the beginning, while a bare card play preserves the card's own resume setting.

Library view
CleanShot 2026-05-27 at 10 07 42

Card view
CleanShot 2026-05-27 at 10 07 51

Type of change

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

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (`ruff format homeassistant tests`)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: `python3 -m script.hassfest`.
  • New or updated dependencies have been added to `requirements_all.txt`.
    Updated by running `python3 -m script.gen_requirements_all`.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @cdnninja, mind taking a look at this pull request as it has been labeled with an integration (yoto) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of yoto can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign yoto Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds media browser support and yoto:// URI-driven targeted playback for the Yoto media player integration.

Changes:

  • Implement async_browse_media to expose the user’s Yoto card library (cards → chapters → tracks) with compact navigation rules.
  • Implement async_play_media to resolve yoto://card[/chapter[/track]] URIs into play_card calls.
  • Extend test coverage and snapshots to validate browse/play behavior and updated supported features.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
homeassistant/components/yoto/media_player.py Adds browse/play media support and yoto:// URI parsing/building.
homeassistant/components/yoto/strings.json Adds new translated exception messages for browse/play validation and failures.
tests/components/yoto/conftest.py Expands mock card data to include chapters/tracks for browse/play tests.
tests/components/yoto/test_media_player.py Adds tests for play_media routing, validation, and browse tree behavior.
tests/components/yoto/snapshots/test_media_player.ambr Updates snapshots for new supported feature flags.

Comment thread homeassistant/components/yoto/media_player.py
Comment thread homeassistant/components/yoto/media_player.py Outdated
Comment thread homeassistant/components/yoto/media_player.py
Comment thread homeassistant/components/yoto/strings.json
Comment thread tests/components/yoto/test_media_player.py
Comment thread tests/components/yoto/test_media_player.py
@piitaya piitaya marked this pull request as draft May 27, 2026 08:37
@piitaya piitaya marked this pull request as ready for review May 27, 2026 08:54
Copilot AI review requested due to automatic review settings May 27, 2026 08:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/yoto/media_player.py
Comment thread homeassistant/components/yoto/media_player.py
Copilot AI review requested due to automatic review settings June 1, 2026 13:44
@piitaya piitaya force-pushed the media_browser_yoto branch from c8515c0 to 193bb57 Compare June 1, 2026 13:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment on lines +28 to +30
# First path segment names the content type. Only cards exist today;
# reserving it leaves room for groups without breaking URIs.
URI_CARD = "card"
Comment thread homeassistant/components/yoto/media_player.py Outdated
Comment thread homeassistant/components/yoto/manifest.json Outdated
Comment thread tests/components/yoto/test_media_player.py
@home-assistant home-assistant Bot marked this pull request as draft June 1, 2026 14:39
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Jun 1, 2026

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copilot AI review requested due to automatic review settings June 1, 2026 15:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread homeassistant/components/yoto/media_player.py
Comment thread homeassistant/components/yoto/media_player.py
Comment thread homeassistant/components/yoto/media_player.py
Copilot AI review requested due to automatic review settings June 1, 2026 15:40
@piitaya piitaya force-pushed the media_browser_yoto branch from 74a236e to 43bf95d Compare June 1, 2026 15:40
@piitaya piitaya marked this pull request as ready for review June 1, 2026 15:41
@home-assistant home-assistant Bot requested a review from joostlek June 1, 2026 15:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@joostlek joostlek merged commit e45f64b into dev Jun 1, 2026
34 checks passed
@joostlek joostlek deleted the media_browser_yoto branch June 1, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants