Commit Graph

102 Commits (1e001469f6315dcadebd0316fd1878c9b8dcbdee)

Author SHA1 Message Date
tronikos 4c0fb04f61
Make tts options of type list (such as profiles in google_cloud) work (#121582)
* Allow tts options of type list such as profiles in google_cloud

* Update tests/components/tts/test_media_source.py

* Don't mix engine specific options with other options

* Fix test

* Update assist_pipeline snapshots

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-24 00:07:12 -07:00
Erik Montnemery 6cd99e4ed4
Add issue asking users to disable ESPHome assist_in_progress sensor (#125805)
* Add issue asking users to disable ESPHome assist_in_progress binary sensor

* Include integration name in title and description

* Add repair flow

* Improve test coverage
2024-09-21 17:14:12 -04:00
Michael Hansen 4ecc6555bf
Add support for sample bytes in preferred TTS format (#125235) 2024-09-04 13:42:41 -04:00
Erik Montnemery cff4e46694
Deduplicate TTS mocks (#124773) 2024-08-28 13:48:49 +02:00
Erik Montnemery 1add00a68d
Deduplicate STT mocks (#124754) 2024-08-28 09:25:56 +02:00
Erik Montnemery 7b71f024fb
Prefer stt entity over legacy stt provider (#124625)
* Prefer stt entity over legacy stt provider

* Update assist_pipeline tests
2024-08-26 13:43:14 +02:00
Michael Hansen 156e39ebb2
Add minimum command seconds to VAD (#124447) 2024-08-24 22:21:03 +02:00
Michael Hansen f2d39feec0
Adjust VAD seconds better for microVAD (#123942) 2024-08-15 11:08:40 +02:00
epenet 3e967700fd
Add missing return type in test __init__ method (part 2) (#123939)
* Add missing return type in test __init__ method (part 2)

* Adjust

* One more

* One more

* More
2024-08-14 17:59:15 +02:00
epenet ba54a19d4b
Simplify mock_tts_cache_dir_autouse fixture (#123783) 2024-08-13 18:01:06 +02:00
Joost Lekkerkerker e8d7eb05ae
Delete unused snapshots (#123656)
* Delete unused snapshots

* Delete unused snapshots
2024-08-12 13:28:09 +02:00
Michael Hansen 80aa2c269b
Standardize assist pipelines on 10ms chunk size (#123024)
* Make chunk size always 10ms

* Fix voip
2024-08-01 22:39:17 +02:00
Michael Hansen 7f4dabf546
Switch from WebRTC to microVAD (#122861)
* Switch WebRTC to microVAD

* Remove webrtc-noise-gain from licenses
2024-07-31 09:42:45 +02:00
Paulus Schoutsen 154da1b18b
Allow targeting conversation agent as pipeline (#119556)
* Allow targetting conversation agent as pipeline

* Test that we can use a conversation entity as an assist pipeline

* Add test for WS get

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
2024-07-09 10:56:53 -05:00
Marc Mueller 2f0dd6f704
Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
J. Nick Koston dbd3147c9b
Remove `async_late_forward_entry_setups` and instead implicitly hold the lock (#119088)
* Refactor config entry forwards to implictly obtain the lock instead of explictly

This is a bit of a tradeoff to not need async_late_forward_entry_setups

The downside is we can no longer detect non-awaited plastform setups
as we will always implicitly obtain the lock instead of explictly.

Note, this PR is incomplete and is only for discussion purposes
at this point

* preen

* cover

* cover

* restore check for non-awaited platform setup

* cleanup

* fix missing word

* make non-awaited test safer
2024-06-12 21:06:11 -04:00
epenet 9008b4295c
Improve type hints in assist_pipeline tests (#119066) 2024-06-07 12:39:25 -05:00
Marc Mueller 279483ddb0
Import Generator from typing_extensions (2) (#118989) 2024-06-06 17:24:22 +02:00
J. Nick Koston ed0568c655
Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
epenet f178467b0e
Add type hints for TTS test fixtures (#118704) 2024-06-03 17:43:18 +02:00
epenet 8837c50da7
Use registry fixtures in tests (a-h) (#118288) 2024-05-28 13:15:16 +02:00
Marc Mueller 905adb2431
Update codespell ignore list (#118018) 2024-05-24 10:24:34 +02:00
Thomas55555 528d67ee06
Remove unused snapshots [a-f] (#117999) 2024-05-24 08:28:04 +02:00
Paulus Schoutsen f9a7e6bb9f
Add migration logic to assist_pipeline (#115172) 2024-04-08 11:29:55 -04:00
Paulus Schoutsen d2e4f5f36e
Add conversation entity (#114518)
* Default agent as entity

* Migrate constant to point at new value

* Fix tests

* Fix more tests

* Move assist pipeline back to cloud after dependenceis
2024-04-01 21:34:25 -04:00
Sid d5f883fbf0
Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
Michael Hansen 6fafb9c9b4
Filter preferred TTS format options if not supported (#114392)
Filter preferred format options if not supported
2024-03-28 11:09:15 -05:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Sid 82a60fe8ad
Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
Joost Lekkerkerker 690ba103ed
Improve lists in integrations [A] (#113006)
* Use list comprehension [A]

* Use list comprehension [A]

* Update homeassistant/components/aws/notify.py
2024-03-11 16:17:44 +01:00
Marc Mueller aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller 38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
J. Nick Koston f3a9756f81
Avoid waiting for integration platforms in the parent integration (#112467) 2024-03-05 21:16:42 -10:00
Michael Hansen f6622ea8e0
Add speech-to-text cooldown for local wake word (#108806)
* Deconflict based on wake word

* Undo test

* Make wake up key a string, rename error

* Update snapshot

* Change to "wake word phrase" and normalize

* Move normalization into the wake provider

* Working on describe

* Use satellite info to resolve wake word phrase

* Add test for wake word phrase

* Match phrase with model name in wake word provider

* Check model id

* Use one constant wake word cooldown

* Update homeassistant/components/assist_pipeline/error.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Fix wake word tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-02-26 20:35:19 -05:00
Michael Hansen 9752e70675
Intents package combines sentences/responses per language (#109079) 2024-01-30 12:38:29 +01:00
Paulus Schoutsen f1d2868fd0
Add API to fetch Assist devices (#107333)
* Add API to fetch Assist devices

* Revert some changes to fixture, make a single fixture for an Assist device
2024-01-05 23:30:18 -05:00
Michael Hansen 269500cb29
Report missing entities/areas instead of failing to match in Assist (#107151)
* Report missing entities/areas instead of failing

* Fix test

* Update assist pipeline test snapshots

* Test complete match failure

* Fix conflict
2024-01-04 17:09:20 -06:00
Martin Hjelmare e1f31194f7
Move cloud stt engine to config entry (#99608)
* Migrate cloud stt to config entry

* Update default engine

* Test config flow

* Migrate pipelines with cloud stt engine to new engine id

* Fix test after rebase

* Update and add comment

* Remove cloud specifics from default stt engine

* Refactor cloud assist pipeline

* Fix cloud stt entity_id

* Try to wait for platforms before creating default pipeline

* Clean up import

* Move function in cloud assist pipeline

* Wait for tts platform loaded in stt migration

* Update deprecation dates

* Clean up not used fixture

* Add test for async_update_pipeline

* Define pipeline update interface better

* Remove leftover

* Fix tests

* Change default engine test

* Add test for missing stt entity during login

* Add and update comments

* Update config entry title
2023-12-21 13:39:02 +01:00
Martin Hjelmare 2e448d2d13
Remove cloud details from assist pipeline (#105687)
* Remove cloud details from assist pipeline

* Update assist pipeline tests

* Update cloud tests
2023-12-14 10:15:59 +01:00
Michael Hansen a73e86a741
Skip TTS events entirely with empty text (#105617) 2023-12-13 00:21:16 -05:00
Michael Hansen 4c4ad9404f
Don't return TTS URL in Assist pipeline (#105164)
* Don't return TTS URL

* Add test for empty queue
2023-12-07 15:28:04 -05:00
Michael Hansen d793203163
Skip TTS when text is empty (#104741)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-11-30 01:31:27 +01:00
Michael Hansen f605df5bf2
Adjust logbook message for assist pipeline recording (#104105)
* Adjust logbook message

* Fix test
2023-11-16 23:39:08 -05:00
Michael Hansen b3e247d5f0
Add websocket command to capture audio from a device (#103936)
* Add websocket command to capture audio from a device

* Update homeassistant/components/assist_pipeline/pipeline.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Add device capture test

* More tests

* Add logbook

* Remove unnecessary check

* Remove seconds and make logbook message past tense

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-11-16 10:28:06 -06:00
Erik Montnemery 4536fb3541
Remove mock_entity_platform test helper (#104073) 2023-11-16 16:55:08 +01:00
Franck Nijhof 04e0e2bd75
Update a* tests to use device & entity registry fixtures (#103711) 2023-11-09 20:46:20 +01:00
Michael Hansen ae516ffbb5
Automatically convert TTS audio to MP3 on demand (#102814)
* Add ATTR_PREFERRED_FORMAT to TTS for auto-converting audio

* Move conversion into SpeechManager

* Handle None case for expected_extension

* Only use ATTR_AUDIO_OUTPUT

* Prefer MP3 in pipelines

* Automatically convert to mp3 on demand

* Add preferred audio format

* Break out preferred format

* Add ATTR_BLOCKING to allow async fetching

* Make a copy of supported options

* Fix MaryTTS tests

* Update ESPHome to use "wav" instead of "raw"

* Clean up tests, remove blocking

* Clean up rest of TTS tests

* Fix ESPHome tests

* More test coverage
2023-11-06 15:26:00 -05:00
Michael Hansen a52761171f
No cooldown when wake words have the same id (#101846)
* No cooldown when wake words have the same id

* Use wake word entity id in cooldown decision
2023-10-23 13:12:34 -04:00
Michael Hansen 257686fcfe
Dynamic wake word loading for Wyoming (#101827)
* Change supported_wake_words property to async method

* Add test

* Add timeout + test

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-10-11 10:21:32 -07:00