/
/
/
# What does this implement/fix?
Home Assistant's TTS entities accept integration-specific options — a
Piper voice, a `length_scale`, a speaking cadence — and its
`tts_get_url` endpoint already takes them. Music Assistant never sent
any, so an AI Radio host was stuck with whatever voice the entity
defaults to.
A host now carries an optional `options` dict that is passed straight
through to the engine.
- Add `options` to `PluginProvider.get_tts_message` and to both TTS
helpers, defaulted so every existing caller is unaffected.
- The Home Assistant provider adds them to its `tts_get_url` payload
when non-empty.
- Store them per host, defaulting to `{}`, so hosts already on disk
normalize unchanged. Values keep their JSON type, since HA hands them to
the integration as-is and `length_scale` has to arrive as a number.
- A rejected option now fails loudly. HA validates option names against
the entity's `supported_options` and returns a 400, and it returns the
same 400 for an unsupported language — which is the case the existing
language retry exists for. So an options rejection is raised as a
`MusicAssistantError` carrying HA's own "Invalid options found: [...]"
text, which propagates instead of triggering a pointless retry; every
other failure keeps its current behaviour.
**Related issue (if applicable):**
- n/a
**Companion frontend PR:**
https://github.com/music-assistant/frontend/pull/2498
## Types of changes
<!--
Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives
the label from the ticked box and applies it automatically; the
release-notes generator uses that same label to slot this change
into the next release notes.
-->
- [ ] Bugfix (non-breaking change which fixes an issue) — `bugfix`
- [ ] New feature (non-breaking change which adds functionality) —
`new-feature`
- [x] Enhancement to an existing feature — `enhancement`
- [ ] New music/player/metadata/plugin provider — `new-provider`
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected) — `breaking-change`
- [ ] Refactor (no behaviour change) — `refactor`
- [ ] Documentation only — `documentation`
- [ ] Maintenance / chore — `maintenance`
- [ ] CI / workflow change — `ci`
- [ ] Dependencies bump — `dependencies`
## Checklist
- [x] The code change is tested and works locally.
- [x] `pre-commit run --all-files` passes.
- [x] `pytest` passes, and tests have been added/updated under `tests/`
where applicable.
- [ ] For changes to shared models, the companion PR in
`music-assistant/models` is linked.
- [x] For changes affecting the UI, the companion PR in
`music-assistant/frontend` is linked.
- [x] I have read and complied with the project's [AI
Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md)
for any AI-assisted contributions.
- [ ] I have [raised a PR against the documentation
repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md)
targeting the main or beta branch as appropriate.