Skip to content

Yandex smarthome: playlists as input_source + experimental Dialogs voice skill (v1.6.1)#3834

Open
trudenboy wants to merge 15 commits intomusic-assistant:devfrom
trudenboy:upstream/yandex_smarthome
Open

Yandex smarthome: playlists as input_source + experimental Dialogs voice skill (v1.6.1)#3834
trudenboy wants to merge 15 commits intomusic-assistant:devfrom
trudenboy:upstream/yandex_smarthome

Conversation

@trudenboy
Copy link
Copy Markdown
Contributor

@trudenboy trudenboy commented May 4, 2026

Summary

Bumps the yandex_smarthome plugin provider from v1.4.5 → v1.6.1. Two main additions: MA library playlists surfaced as Yandex mode(input_source) slots (v1.5.x), and an experimental Yandex Dialogs custom skill for free-form voice playback (v1.6.x).

Source repo: trudenboy/ma-provider-yandex-smarthome · tag v1.6.1

Docs PR: music-assistant/music-assistant.io#623 — user-facing setup walkthrough for the playlist workaround.

What's new (v1.4.5 → v1.6.1)

Added — v1.6.0

  • Experimental Yandex Dialogs custom skill for free-form voice playback (direct mode only). A second skill type (separate from Smart Home) that lets users say "Alice, ask Music Assistant to play Metallica in the kitchen" and have MA search for the content and start playback on the named player.
    • New modules: dialogs_nlu.py (command parser + player resolver), dialogs_player.py (content resolver + play wrapper), dialogs.py (aiohttp webhook handler).
    • NLU parser classifies Russian voice commands into kinds: track, artist, album, playlist, my_wave, genre, search. Extracts an optional "on <player>" location suffix and fuzzy-matches player names with Russian inflection stripping (e.g. the locative form "in the kitchen" correctly resolves to a player named "Kitchen").
    • Content resolver dispatches to mass.music.search by kind, with special-case paths for My Wave (yandex_music rotor user:onyourwave) and genre radio (yandex_music genre rotor with artist-search fallback).
    • Webhook handler authenticates via URL path-secret + body.session.skill_id, keeps a 200-entry in-memory LRU session cache so follow-up commands remember which player was chosen, powers the player on before playback if needed, and fires play via self.mass.create_task to stay within Yandex's 4.5 s response budget.
    • Auto-create pipeline extendedauto_skill.py is now parameterised by skill_type ("smart_home" | "dialog"); the dialog path builds a separate draft payload and injects the generated webhook URL. New auto_rename_dialog_skill helper patches the skill name in Yandex Dialogs and re-deploys.
    • Config UI (direct mode only) — toggle Enable Dialogs voice skill (experimental), skill activation name, auto-create action, rename-drift detection, hidden storage for artifacts/secret. The toggle is invisible in cloud/cloud_plus mode.
    • Full test coverage: 30+ table-driven NLU parse cases, player resolver cases, content resolver unit tests, and webhook handler end-to-end tests.

Added — v1.5.0

  • MA library playlists as Yandex mode(input_source) slots. A new "Exposed Playlists" config (multi-select from MA library, max 10) appears as mode(input_source) values on every exposed player. Native player sources keep priority and fill slots first; playlists fill the remainder. Trigger is ordinal only — Alice recognises the fixed catalogue values one..ten (e.g. "Alice, switch <player> source to five"). Action on a playlist slot powers the player on if needed and starts playback via mass.player_queues.play_media.

Fixed

  • Upstream mypy compliance for test files (v1.6.1) — bare list/dict generic types in _SearchResults dataclass fields annotated as list[object] / dict[str, object]; resolve_player calls with MockMass stub suppressed via # type: ignore[arg-type].
  • mass.create_task for background play task (v1.6.0) — replaced bare asyncio.create_task with self._mass.create_task so the playback task is tracked in the MA lifecycle and unhandled exceptions are logged by the framework's task handler.
  • Webhook skill_id check rejects absent/empty skill_id (v1.6.0) — comparison uses secrets.compare_digest for constant-time safety.
  • NLU verb regex covers additional imperative verb forms (v1.6.0) — prior regex missed some conjugations, leaving the raw verb in the search query.
  • Misleading "Exposed Playlists" config description (v1.5.3) — description now reflects ordinal-only triggering.
  • Playlist picker no longer silently truncated at 500 (v1.5.2) — fetch_playlist_options now pages through iter_library_items.

Changed files (vs v1.4.5)

File Status
yandex_smarthome/__init__.py modified
yandex_smarthome/auto_skill.py modified
yandex_smarthome/auto_skill_state.py modified
yandex_smarthome/auto_skill_ui.py modified
yandex_smarthome/constants.py modified
yandex_smarthome/device.py modified
yandex_smarthome/dialogs.py added
yandex_smarthome/dialogs_nlu.py added
yandex_smarthome/dialogs_player.py added
yandex_smarthome/direct.py modified
yandex_smarthome/handlers.py modified
yandex_smarthome/notifier.py modified
yandex_smarthome/playlists.py added
yandex_smarthome/plugin.py modified
tests/.../test_auto_skill.py modified
tests/.../test_device.py modified
tests/.../test_dialogs.py added
tests/.../test_dialogs_nlu.py added
tests/.../test_dialogs_player.py added
tests/.../test_handlers.py modified

Verification

  • pytest tests/providers/yandex_smarthome/ — 340+ passed on source repo
  • ruff + mypy clean (no errors vs upstream baseline)
  • All Copilot review threads on source PRs resolved

🤖 Generated with Claude Code

@trudenboy trudenboy changed the title feat(yandex_smarthome): add yandex_smarthome provider v1.5.0 feat(yandex_smarthome): expose MA library playlists as input_source modes (v1.5.0) May 4, 2026
@trudenboy trudenboy marked this pull request as ready for review May 4, 2026 10:24
Copilot AI review requested due to automatic review settings May 4, 2026 10:24
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

This PR bumps the yandex_smarthome plugin to v1.5.0 and adds support for exposing configured MA library playlists as Yandex mode(input_source) values, enabling Alice voice commands to start playlist playback via player_queues.play_media.

Changes:

  • Add “Exposed Playlists” configuration and plumb playlist_uris through cloud/direct handlers and state notifier.
  • Extend device mapping to publish combined native sources + playlist-backed mode(input_source) slots (capped at 10) and route mode actions to either players.select_source or player_queues.play_media.
  • Add a small playlists.py seam plus tests covering the new mode registration and action routing.

Reviewed changes

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

Show a summary per file
File Description
music_assistant/providers/yandex_smarthome/__init__.py Adds config UI entry for selecting playlists and loads options from MA library.
music_assistant/providers/yandex_smarthome/constants.py Introduces CONF_EXPOSED_PLAYLISTS and MAX_INPUT_SOURCES (10).
music_assistant/providers/yandex_smarthome/device.py Implements combined input_source slots and executes playlist-backed mode actions via queue playback.
music_assistant/providers/yandex_smarthome/direct.py Passes configured playlist URIs through the direct HTTP handlers.
music_assistant/providers/yandex_smarthome/handlers.py Threads playlist_uris through device list/query/action handling.
music_assistant/providers/yandex_smarthome/notifier.py Includes playlist-aware input_source capability/state reporting in callbacks.
music_assistant/providers/yandex_smarthome/playlists.py New helper module for config options + starting playlist playback.
music_assistant/providers/yandex_smarthome/plugin.py Parses/sanitizes playlist URI config and wires it into handlers/notifier.
tests/providers/yandex_smarthome/test_device.py Adds coverage for combined modes and playlist/native action routing.
tests/providers/yandex_smarthome/test_handlers.py Adds coverage that playlist URIs trigger mode(input_source) capability registration.

Comment thread music_assistant/providers/yandex_smarthome/device.py Outdated
Comment thread music_assistant/providers/yandex_smarthome/playlists.py Outdated
@trudenboy trudenboy changed the title feat(yandex_smarthome): expose MA library playlists as input_source modes (v1.5.0) Yandex smarthome: expose MA library playlists as input_source modes (v1.5.0) May 4, 2026
@trudenboy trudenboy changed the title Yandex smarthome: expose MA library playlists as input_source modes (v1.5.0) Yandex smarthome: expose MA library playlists as input_source modes (v1.5.2) May 4, 2026
Copilot AI review requested due to automatic review settings May 4, 2026 12:22
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 10 out of 10 changed files in this pull request and generated no new comments.

@trudenboy trudenboy changed the title Yandex smarthome: expose MA library playlists as input_source modes (v1.5.2) Yandex smarthome: expose MA library playlists as input_source modes (v1.5.3) May 4, 2026
Copilot AI review requested due to automatic review settings May 4, 2026 20:12
@trudenboy trudenboy changed the title Yandex smarthome: expose MA library playlists as input_source modes (v1.5.3) Yandex smarthome: playlists as input_source + experimental Dialogs voice skill (v1.6.1) May 4, 2026
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 20 out of 20 changed files in this pull request and generated 3 comments.

Comment thread music_assistant/providers/yandex_smarthome/dialogs.py
Comment thread music_assistant/providers/yandex_smarthome/dialogs_player.py
Comment thread music_assistant/providers/yandex_smarthome/dialogs_player.py
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