Commit Graph

96 Commits (ad7a334147213e01e45b5ea15804d75629e3f362)

Author SHA1 Message Date
Michael Hansen 50b897bdaa
Add STT error code for cloud authentication failure (#133170) 2024-12-13 14:59:46 -05:00
Michael Hansen 94260147d7
Fix pipeline conversation language (#132896) 2024-12-11 18:52:02 +01:00
Jan-Philipp Benecke 6b7724c556
Track if intent was processed locally (#132166) 2024-12-04 09:52:15 +01:00
Michael 1a9ab07742
Allow empty trigger sentence responses in conversations (#131849)
allow empty trigger sentence responses
2024-11-28 18:30:05 +01:00
Michael Hansen 7621012ee6
Ensure sentence triggers are only checked once (#131210)
Co-authored-by: Artur Pragacz <49985303+arturpragacz@users.noreply.github.com>
2024-11-22 17:38:19 +01:00
Michael Hansen 5fa9a945d9
Handle sentence triggers and local intents before pipeline agent (#129058)
* Handle sentence triggers and registered intents in Assist LLM API

* Remove from LLM

* Check sentence triggers and local intents first

* Fix type

* Fix type again

* Use pipeline language

* Fix cloud test

* Clean up and fix translation key

* Refactor async_recognize
2024-11-14 10:50:50 -06:00
Michael Hansen 69e3348cd7
Use different VAD thresholds for before and during voice command (#129848)
* Use two VAD thresholds

* Fix VoiceActivityTimeout class

* Update homeassistant/components/assist_pipeline/audio_enhancer.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-11-05 08:01:45 -06:00
epenet 47a9dda3b8
Use root import in components (#125858) 2024-09-12 22:21:21 +02:00
Paulus Schoutsen ff3cabbf3a
Small Assist Satellite fixes (#125384) 2024-09-06 07:36:02 -04:00
Michael Hansen 4ecc6555bf
Add support for sample bytes in preferred TTS format (#125235) 2024-09-04 13:42:41 -04:00
Paulus Schoutsen 1aa0dbdaf5
Revert "Revert "Use speex for noise suppression and auto gain"" (#124637)
Revert "Revert "Use speex for noise suppression and auto gain" (#124620)"

This reverts commit 302ffe5e56.
2024-08-26 15:10:43 +02:00
Paulus Schoutsen 302ffe5e56
Revert "Use speex for noise suppression and auto gain" (#124620)
Revert "Use speex for noise suppression and auto gain (#124591)"

This reverts commit 592f60643a.
2024-08-26 10:12:05 +02:00
Michael Hansen 592f60643a
Use speex for noise suppression and auto gain (#124591) 2024-08-25 23:50:32 -05: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 d5388452d4
Use finished speaking detection in ESPHome/Wyoming (#122962) 2024-07-31 20:39:03 +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
Paulus Schoutsen 01861cd240
Ensure we prepare conversation pipeline when speech-to-text starts (#114665)
* Ensure we prepare conversation pipeline when speech-to-text starts

* Add lock around recognize

* Update homeassistant/components/conversation/default_agent.py

* Add lock around load intents
2024-07-09 09:58:52 -05:00
Paulus Schoutsen 22718ca32a
Assist Pipeline minor cleanup (#121187) 2024-07-05 09:26:32 +02:00
Paulus Schoutsen 869f24df49
Convert async_get_conversation_languages from async to callback (#121162)
* Convert get_languages to callback

* One more callback
2024-07-04 10:41:31 +02:00
Marc Mueller ca55986057
Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +02:00
Joost Lekkerkerker 1fdd056c0e
Fix ruff manual-dict-comprehension PERF403 (#120723)
* Fix PERF403

* Fix

* Fix
2024-06-28 14:17:47 +02:00
Marc Mueller b393024acd
Improve collection schema typing (#120441) 2024-06-25 18:57:15 +02:00
Erik Montnemery 0d1b050520
Remove create_create from StorageCollectionWebsocket.async_setup (#119489) 2024-06-24 15:41:08 +02:00
Erik Montnemery e0378f79a4
Remove create_list from StorageCollectionWebsocket.async_setup (#119508) 2024-06-17 12:16:36 +02:00
epenet 960d1289ef
Avoid references to websocket_api.const in core and other components (#119285) 2024-06-10 13:49:44 +02:00
Marc Mueller fe21e2b8ba
Import Generator from typing_extensions (1) (#118986) 2024-06-06 17:02:13 +02:00
Marc Mueller 87bb7ced79
Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
Sid 2cc916db6d
Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
Paulus Schoutsen f9a7e6bb9f
Add migration logic to assist_pipeline (#115172) 2024-04-08 11:29:55 -04:00
Sid 8e98ba7312
Add first batch of Ruff PYI rules (#115100)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-07 11:30:50 -10: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
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
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 ff3a801936
Add empty line after module docstring [a-d] (#112697) 2024-03-08 14:51:32 +01: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
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
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
Aarni Koskela 706add4a57
Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
J. Nick Koston cc31d77205
Use ulid_now instead of ulid_at_timestamp if no timestamp is passed (#104226)
* Use ulid_now instead of ulid_at_timestamp if no timestamp is passed

ulid_now is slightly faster than ulid_at_timestamp

* tweak usage
2023-11-19 22:27:24 -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
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 a78e3f7b0f
Delay import of webrtc to avoid blocking start up if package is missing (#102594)
* Delay import of webrtc to avoid blocking start up if package is missing

* Update homeassistant/components/assist_pipeline/pipeline.py

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

* Update homeassistant/components/assist_pipeline/vad.py

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

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-10-23 13:34:32 -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 244f6d8002
Add wake word cooldown to avoid duplicate wake-ups (#101417) 2023-10-06 09:18:35 +02:00
Michael Hansen e6504218bc
Pipeline runs are only equal with same id (#101341)
* Pipeline runs are only equal with same id

* Use dict instead of list in PipelineRuns

* Let it blow up

* Test

* Test rest of __eq__
2023-10-03 16:52:31 -05:00