Update yandex_smarthome provider to v1.4.5 — auto-create skill flow#3785
Merged
MarvinSchenkel merged 6 commits intomusic-assistant:devfrom Apr 28, 2026
Merged
Conversation
trudenboy
added a commit
to trudenboy/ma-provider-yandex-smarthome
that referenced
this pull request
Apr 24, 2026
….0 bundle The auto-generated bundle PR (music-assistant/server#3785) failed on three upstream-only checks that our local tooling did not catch: - check-docstring-first flagged the bare `"""..."""` under `DEVICE_FLOW_TIMEOUT_SECONDS` as a second module docstring; convert it to a regular `#` comment. - mypy strict mode in upstream rejected `SkillCreationState.DONE == "done"` (StrEnum vs literal) — switch the two assertions in the test to use `.value` so the comparison is str-vs-str. - upstream strict mypy also disallows `# type: ignore[no-untyped-def]` on helper fns that can be properly annotated. Give `_find`, the three `_entries`/`_call` helpers, and the multi-line `monkeypatch` fixture signature real type annotations. `ConfigEntry` / `Iterable` / `Sequence` are pushed under `TYPE_CHECKING` to keep TC002 happy. Bump to v1.4.1 so upstream re-pulls with the fixes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Bumps the bundled Yandex Smart Home provider to v1.4.0 by adding a resumable “auto-create Yandex Dialogs skill” pipeline (device-flow auth + Dialogs API orchestration) and updating the config UI to a step-based flow for cloud_plus and direct, with comprehensive unit + snapshot coverage.
Changes:
- Add Dialogs API client + resumable orchestrator to auto-create/publish a private Smart Home skill.
- Refactor provider config UI into numbered steps (cloud_plus) / single step (direct) and persist auto-create artifacts across retries.
- Add extensive unit tests (including snapshot payload tests) for state serialization, UI visibility/gating, and config-action wiring.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
music_assistant/providers/yandex_smarthome/__init__.py |
Wires new config actions/UI builders and persists auto-create artifacts/session id via config flow. |
music_assistant/providers/yandex_smarthome/constants.py |
Adds config keys for auto-create artifacts/session id + new action constant. |
music_assistant/providers/yandex_smarthome/auto_skill.py |
Implements Dialogs API client, device-flow authenticator, and resumable auto-create/publish orchestrator. |
music_assistant/providers/yandex_smarthome/auto_skill_state.py |
Adds artifacts/state model + (de)serialization for resumable orchestration. |
music_assistant/providers/yandex_smarthome/auto_skill_ui.py |
Builds step-based ConfigEntry UI for cloud_plus/direct with retry + manual fallback fields. |
music_assistant/providers/yandex_smarthome/auto_skill_logo.png |
Bundled default skill logo asset used by auto-create flow. |
tests/providers/yandex_smarthome/test_config_actions.py |
Tests _handle_config_actions integration for auto-create action (artifact persistence, session id wiring, secret resolution). |
tests/providers/yandex_smarthome/test_auto_skill_ui.py |
Tests UI gating/visibility/action-label logic across states and connection types. |
tests/providers/yandex_smarthome/test_auto_skill_state.py |
Tests artifact JSON round-tripping, validation behavior, and immutability. |
tests/providers/yandex_smarthome/test_auto_skill.py |
Tests Dialogs client methods, payload builders (snapshots), preconditions, and orchestrator resume/failure behavior. |
tests/providers/yandex_smarthome/__snapshots__/test_auto_skill.ambr |
Snapshot baselines for draft/oauth payload builders. |
5 tasks
MarvinSchenkel
approved these changes
Apr 28, 2026
Contributor
MarvinSchenkel
left a comment
There was a problem hiding this comment.
Thanks @trudenboy !
fionn-r
pushed a commit
to fionn-r/music-assistant-server
that referenced
this pull request
May 4, 2026
…usic-assistant#3785) ## Yandex Smart Home provider v1.4.5 **Source**: [trudenboy/ma-provider-yandex-smarthome](https://github.com/trudenboy/ma-provider-yandex-smarthome) · tag [v1.4.5](https://github.com/trudenboy/ma-provider-yandex-smarthome/releases/tag/v1.4.5) Bumps the bundled provider from **v1.3.0 → v1.4.5**. No upstream core changes — all code lives under `music_assistant/providers/yandex_smarthome/` and `tests/providers/yandex_smarthome/`. --- ### Headline: auto-create Yandex Dialogs skill For `cloud_plus` and `direct` modes the config flow now creates the private Yandex Dialogs skill automatically. The user logs in once via OAuth Device Flow (`ya.ru/device`) against Yandex Passport, and the provider then drives the undocumented `dialogs.yandex.ru/developer/app-store-api` endpoints to create the app, upload the logo, update the draft, create and attach an OAuth app, and request deploy — replacing ~10 minutes of manual copy-paste across several Yandex pages. The pipeline is resumable: partial failures persist step-level artifacts (`skill_id`, `logo_id`, `oauth_app_id`, `state`) so retry continues from the last completed step. ### UX - **Numbered steps** — `cloud_plus` shows Register → Create skill → Link (OTP); `direct` shows Create skill only. Later steps are hidden until the previous one is complete. - **Automatic manual fallback** — on failure the form unfolds copy-paste fields (Backend URL, Client ID/Secret, Auth/Token URLs, Dialogs console link) so the user can finish in `dialogs.yandex.ru` by hand without leaving MA settings. - **Advanced view** — all manual-setup reference values stay available for power users, even when auto-create succeeds. - **Configured-state collapse** — once Skill ID + OAuth token are saved, edit fields collapse into a single \"Open skill in Yandex.Dialogs\" link. - **Cloud-mode advisory** — warns that the public Yaha Cloud skill allows only one linked instance per Yandex account and suggests Cloud Plus for multi-install setups. - **Connection Type** moved out of Advanced — it's the first decision and should render in the default view. ### Removed - `experimental_auto_create_skill` master toggle — auto-create is on by default. --- ### Changes since the initial bundle (review feedback in this PR) - **Cloud Plus manual fallback hidden before registration** — `cloud_plus` Client ID template embeds the yaha-cloud instance UUID; before the user clicks Register it was rendering as `yandex_smart_home:` (empty UUID). The manual block is now suppressed entirely for cloud_plus while `cloud_instance_id` is empty, so Advanced view can't surface a half-formed Client ID. - **SECURE_STRING `CONF_DIRECT_CLIENT_SECRET` round-trip** — prefer the persisted secret from `saved_config` over the (empty on re-open) form value, falling back to a fresh UUID only for first-time setup. - **`asyncio.CancelledError` passthrough** — both broad `except Exception` clauses (orchestrator + config-action handler) now re-raise `CancelledError` so cooperative cancellation during HA shutdown / config-flow abort is preserved instead of being absorbed into a `FAILED` artifact. - **`_build_authenticator_cm` non-idempotent wrap fix** — detects an already-`@asynccontextmanager`-decorated authenticator and passes it through instead of re-wrapping (the outer wrapper would otherwise call `__anext__` on a CM object and crash at runtime). The async-iterator path no longer calls the factory twice. - **`SkillCreationState.DEPLOY_REQUESTED` is now an observable checkpoint** — previously defined and allow-listed in the resume branch but never written; the orchestrator now sets it before `request_deploy`, so mid-publish crashes resume from publish-only. - **Upstream lint/mypy conformance** — docstring-below-constant removed, StrEnum comparisons use `.value`, strict-mypy annotations on test helpers, `"Retry" in action.action_label` narrowed before the `in` check. - Several smaller docstring and log-leak fixes (Copilot review). ### Dependencies No new top-level dependencies. `ya-passport-auth` (already at 1.3.0 from the previous bump) provides the Device Flow / Passport cookie refresh used by the auto-create orchestrator; all Dialogs calls reuse that session. ### Tests 293 unit tests in the upstream provider repo, including syrupy-snapshot tests for the Dialogs API payload builders. Covered: orchestrator state machine (resume from each intermediate state including `DEPLOY_REQUESTED`, Device Flow timeout, CSRF miss, 409 duplicate, `CancelledError` propagation), UI visibility (step gating, advanced/collapse rules, HTTPS/base-URL preconditions for `direct`, SECURE_STRING fallback, cloud_plus manual-block suppression pre-registration), and the `_handle_config_actions` wiring. No live Yandex calls. ### Compatibility - No schema or storage migration — the artifact blob is a single JSON string stored under the existing provider config. - Existing `CONF_SKILL_ID` / `CONF_SKILL_TOKEN` stay editable; auto-create populates `CONF_SKILL_ID` only on full success. - Users on v1.3.0 see the new multi-step UX on next open; no action required from existing installs. --- ### Related - Documentation update: [music-assistant/music-assistant.io#623](music-assistant/music-assistant.io#623) — documents the auto-create skill flow and numbered-step UX introduced here. Full CHANGELOG: [trudenboy/ma-provider-yandex-smarthome/CHANGELOG.md](https://github.com/trudenboy/ma-provider-yandex-smarthome/blob/main/CHANGELOG.md) --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Yandex Smart Home provider v1.4.5
Source: trudenboy/ma-provider-yandex-smarthome · tag v1.4.5
Bumps the bundled provider from v1.3.0 → v1.4.5. No upstream core changes — all code lives under
music_assistant/providers/yandex_smarthome/andtests/providers/yandex_smarthome/.Headline: auto-create Yandex Dialogs skill
For
cloud_plusanddirectmodes the config flow now creates the private Yandex Dialogs skill automatically. The user logs in once via OAuth Device Flow (ya.ru/device) against Yandex Passport, and the provider then drives the undocumenteddialogs.yandex.ru/developer/app-store-apiendpoints to create the app, upload the logo, update the draft, create and attach an OAuth app, and request deploy — replacing ~10 minutes of manual copy-paste across several Yandex pages.The pipeline is resumable: partial failures persist step-level artifacts (
skill_id,logo_id,oauth_app_id,state) so retry continues from the last completed step.UX
cloud_plusshows Register → Create skill → Link (OTP);directshows Create skill only. Later steps are hidden until the previous one is complete.dialogs.yandex.ruby hand without leaving MA settings.Removed
experimental_auto_create_skillmaster toggle — auto-create is on by default.Changes since the initial bundle (review feedback in this PR)
cloud_plusClient ID template embeds the yaha-cloud instance UUID; before the user clicks Register it was rendering asyandex_smart_home:(empty UUID). The manual block is now suppressed entirely for cloud_plus whilecloud_instance_idis empty, so Advanced view can't surface a half-formed Client ID.CONF_DIRECT_CLIENT_SECRETround-trip — prefer the persisted secret fromsaved_configover the (empty on re-open) form value, falling back to a fresh UUID only for first-time setup.asyncio.CancelledErrorpassthrough — both broadexcept Exceptionclauses (orchestrator + config-action handler) now re-raiseCancelledErrorso cooperative cancellation during HA shutdown / config-flow abort is preserved instead of being absorbed into aFAILEDartifact._build_authenticator_cmnon-idempotent wrap fix — detects an already-@asynccontextmanager-decorated authenticator and passes it through instead of re-wrapping (the outer wrapper would otherwise call__anext__on a CM object and crash at runtime). The async-iterator path no longer calls the factory twice.SkillCreationState.DEPLOY_REQUESTEDis now an observable checkpoint — previously defined and allow-listed in the resume branch but never written; the orchestrator now sets it beforerequest_deploy, so mid-publish crashes resume from publish-only..value, strict-mypy annotations on test helpers,"Retry" in action.action_labelnarrowed before theincheck.Dependencies
No new top-level dependencies.
ya-passport-auth(already at 1.3.0 from the previous bump) provides the Device Flow / Passport cookie refresh used by the auto-create orchestrator; all Dialogs calls reuse that session.Tests
293 unit tests in the upstream provider repo, including syrupy-snapshot tests for the Dialogs API payload builders. Covered: orchestrator state machine (resume from each intermediate state including
DEPLOY_REQUESTED, Device Flow timeout, CSRF miss, 409 duplicate,CancelledErrorpropagation), UI visibility (step gating, advanced/collapse rules, HTTPS/base-URL preconditions fordirect, SECURE_STRING fallback, cloud_plus manual-block suppression pre-registration), and the_handle_config_actionswiring. No live Yandex calls.Compatibility
CONF_SKILL_ID/CONF_SKILL_TOKENstay editable; auto-create populatesCONF_SKILL_IDonly on full success.Related
Full CHANGELOG: trudenboy/ma-provider-yandex-smarthome/CHANGELOG.md