Skip to content

Update yandex_smarthome provider to v1.4.5 — auto-create skill flow#3785

Merged
MarvinSchenkel merged 6 commits intomusic-assistant:devfrom
trudenboy:upstream/yandex_smarthome
Apr 28, 2026
Merged

Update yandex_smarthome provider to v1.4.5 — auto-create skill flow#3785
MarvinSchenkel merged 6 commits intomusic-assistant:devfrom
trudenboy:upstream/yandex_smarthome

Conversation

@trudenboy
Copy link
Copy Markdown
Contributor

@trudenboy trudenboy commented Apr 24, 2026

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/ 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 stepscloud_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 registrationcloud_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

Full CHANGELOG: trudenboy/ma-provider-yandex-smarthome/CHANGELOG.md

@trudenboy trudenboy changed the title feat(yandex_smarthome): add yandex_smarthome provider v1.4.0 feat(yandex_smarthome): update to v1.4.0 — auto-create skill flow Apr 24, 2026
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>
@trudenboy trudenboy marked this pull request as ready for review April 24, 2026 14:34
Copilot AI review requested due to automatic review settings April 24, 2026 14:34
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

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.

Comment thread music_assistant/providers/yandex_smarthome/auto_skill.py Outdated
Comment thread music_assistant/providers/yandex_smarthome/auto_skill_state.py
Comment thread tests/providers/yandex_smarthome/test_auto_skill.py
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 11 changed files in this pull request and generated 3 comments.

Comment thread music_assistant/providers/yandex_smarthome/__init__.py
Comment thread music_assistant/providers/yandex_smarthome/auto_skill.py
Comment thread music_assistant/providers/yandex_smarthome/__init__.py
@trudenboy trudenboy changed the title feat(yandex_smarthome): update to v1.4.0 — auto-create skill flow Update yandex_smarthome provider to v1.4.x — auto-create skill flow Apr 24, 2026
@trudenboy trudenboy changed the title Update yandex_smarthome provider to v1.4.x — auto-create skill flow Update yandex_smarthome provider to v1.4.4 — auto-create skill flow Apr 24, 2026
@trudenboy trudenboy requested a review from Copilot April 24, 2026 15: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 10 out of 11 changed files in this pull request and generated 1 comment.

Comment thread music_assistant/providers/yandex_smarthome/auto_skill_ui.py
@trudenboy trudenboy changed the title Update yandex_smarthome provider to v1.4.4 — auto-create skill flow Update yandex_smarthome provider to v1.4.5 — auto-create skill flow Apr 24, 2026
Copy link
Copy Markdown
Contributor

@MarvinSchenkel MarvinSchenkel left a comment

Choose a reason for hiding this comment

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

Thanks @trudenboy !

@MarvinSchenkel MarvinSchenkel merged commit 0020338 into music-assistant:dev Apr 28, 2026
7 of 9 checks passed
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>
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.

4 participants