Commit Graph

66 Commits (0458bd68d9aad50f5e21700eeb1ce4cb3cfaa511)

Author SHA1 Message Date
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
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
Michael Hansen cc7e35e299
Increase pipeline timeout to 5 minutes (#101327) 2023-10-03 19:41:00 +02:00
Erik Montnemery a9bcfe5700
Abort wake word detection when assist pipeline is modified (#100918) 2023-09-26 20:24:55 +02:00
Erik Montnemery 734c4e8e32
Rename WakeWord.ww_id to WakeWord.id (#100903)
* Rename WakeWord.ww_id to WakeWord.wake_word_id

* Revert unrelated changes

* Rename to id

* Correct rebase
2023-09-26 19:12:16 +02:00
Erik Montnemery 1e76d37cee
Rename PipelineData.pipeline_runs to pipeline_debug (#100907) 2023-09-26 11:35:51 +02:00
Michael Hansen 785618909a
Use webrtc-noise-gain for audio enhancement in Assist pipelines (#100698)
* Use webrtc-noise-gain instead of webrtcvad package

* Switching to ProcessedAudioChunk

* Refactor VAD and fix tests

* Add vad no chunking test

* Add test that runs audio enhancements
2023-09-25 20:03:50 -04:00
Erik Montnemery 803d24ad1a
Rename wake_word.async_default_engine to wake_word.async_default_entity (#100855)
* Rename wake_word.async_default_engine to wake_word.async_default_entity

* tweak

* Some more rename

* Update tests
2023-09-25 17:08:37 +02:00
Erik Montnemery 5a3efb9149
Store wakeword settings in assist pipelines (#100847)
* Store wakeword settings in assist pipelines

* wakeword -> wake_word

* Remove unneeded variable
2023-09-25 16:07:26 +02:00
Paulus Schoutsen 23b239ba77
Allow passing a wake word ID to detect wake word (#100832)
* Allow passing a wake word ID to detect wake word

* Do not inject default wake words in wake_word integration
2023-09-25 15:33:54 +02:00
Michael Hansen e69c88a0d2
Use aliases when listing pipeline languages (#99672) 2023-09-08 08:22:08 -04:00
Michael Hansen 054a63c3a2
Add option to save Assist pipeline audio (#98928)
* Add pipeline option to save wake/stt audio to media

* Add debug_recording_dir to assist_pipeline YAML config

* Clean up and additional tests

* Remove I/O in event loop

* Organize saved audio by pipeline name and device id

* Record wake/stt debug audio in separate thread

* Fix after rebase

* Use timestamp instead of pipeline id for directory name

* Add WAV write error test

* Join thread in executor
2023-08-29 23:07:27 -04:00
Michael Hansen 8768c39021
Wake word cleanup (#98652)
* Make arguments for async_pipeline_from_audio_stream keyword-only after hass

* Use a bytearray ring buffer

* Move generator outside

* Move stt stream generator outside

* Clean up execute

* Refactor VAD to use bytearray

* More tests

* Refactor chunk_samples to be more correct and robust

* Change AudioBuffer to use append instead of setitem

* Cleanup

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-08-25 13:28:48 -04:00
Ville Skyttä 3b4774d9ed
Remove unnnecessary pylint configs from components/[a-d]* (#98911) 2023-08-24 00:54:02 +02:00
Michael Hansen 49d2c60992
Add pipeline VAD events (#98603)
* Add stt-vad-start and stt-vad-end pipeline events

* Update tests
2023-08-17 19:58:58 -04:00
Erik Montnemery 1869177f08
Rename some incorrectly named assist_pipeline tests (#98389) 2023-08-14 15:47:55 +02:00
Erik Montnemery 045c327928
Move DeviceInfo from entity to device registry (#98149)
* Move DeviceInfo from entity to device registry

* Update integrations
2023-08-10 22:04:26 -04:00
Michael Hansen 7ea2998b55
Add wake word integration (#96380)
* Add wake component

* Add wake support to Wyoming

* Add helper function to assist_pipeline (not complete)

* Rename wake to wake_word

* Fix platform

* Use send_event and clean up

* Merge wake word into pipeline

* Add wake option to async_pipeline_from_audio_stream

* Add start/end stages to async_pipeline_from_audio_stream

* Add wake timeout

* Remove layer in wake_output

* Use VAD for wake word timeout

* Include audio metadata in wake-start

* Remove unnecessary websocket command

* wake -> wake_word

* Incorporate feedback

* Clean up wake_word tests

* Add wyoming wake word tests

* Add pipeline wake word test

* Add last processed state

* Fix tests

* Add tests for wake word

* More tests for the codebot
2023-08-07 22:22:16 -04:00
Erik Montnemery 7539cf25be
Don't require passing identifiers to DeviceRegistry.async_get_device (#96479)
* Require keyword arguments to DeviceRegistry.async_get_device

* Update tests

* Update tests

* Don't enforce keyword arguments
2023-07-13 13:39:25 -04:00
Michael Hansen 65454c945d
Add VAD sensitivity option to VoIP devices (#94688)
* Add VAD sensitivity option to VoIP devices

* Use select entitiy for VAD sensitivity

* Add sensitivity to tests

* Add to assist pipeline tests

* Update homeassistant/components/assist_pipeline/select.py

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

* Update tests/components/voip/test_voip.py

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-06-23 23:28:13 -04:00
Paulus Schoutsen c42d0feec1
Allow passing in device_id to pipeline run WS API (#95139) 2023-06-23 21:29:56 -05:00
Paulus Schoutsen 65b62d877d
Keep track what devices support Assist features (#93990) 2023-06-03 08:26:28 -05:00
c0ffeeca7 c3a3ddcfa4
Standardize spelling of TTS and STT (#93857)
* Standardize spelling of TTS and STT

* Apply suggestions from code review

* Update homeassistant/components/tts/media_source.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-05-31 11:00:19 -04:00
Erik Montnemery 30d9d7d905
Minor adjustment of tts typing (#93450) 2023-05-24 21:02:55 +02:00
Erik Montnemery 68379dd55a
Improve TTS cache dir mocking (#93468) 2023-05-24 21:00:35 +02:00
Erik Montnemery 887e656570
Small improvement of assist_pipeline test coverage (#92115) 2023-05-04 19:01:41 +02:00
Erik Montnemery f8f7de5d5a
Remove homeassistant from conversation dependencies (#92170)
* Remove homeassistant from conversation dependencies

* Fix tests
2023-04-28 18:17:48 +02:00
Paulus Schoutsen 7c696754ed
Use pipeline ID in event (#92100)
* Use pipeline ID in event

* Fix tests
2023-04-26 22:40:17 -04:00
Erik Montnemery 57a59d808b
Automaticially create an assist pipeline using cloud stt + tts (#91991)
* Automaticially create an assist pipeline using cloud stt + tts

* Return the id of the cloud enabled pipeline

* Wait for platforms to load

* Fix typing

* Fix startup race

* Update tests

* Create a cloud pipeline only when logging in

* Fix tests

* Tweak _async_resolve_default_pipeline_settings

* Improve assist_pipeline test coverage

* Improve cloud test coverage
2023-04-25 20:40:01 -05:00
Erik Montnemery 792ea92e55
Remove fuzzy language matching from stt and tts (#92002)
* Remove fuzzy language matching from stt and tts

* Update tests
2023-04-25 17:54:42 +02:00
Erik Montnemery b601fb17d3
Create a default assist pipeline on start (#91947)
* Create a default assist pipeline on start

* Minor adjustments

* Address review comments

* Remove tts.async_get_agent

* Fix bugs, improve test coverage
2023-04-24 14:00:52 -04:00
Erik Montnemery 1c3e1d2e13
Don't resolve default tts engine in assist pipelines (#91943)
* Don't resolve default tts engine in assist pipelines

* Set tts engine when creating default pipeline

* Update tests
2023-04-24 14:40:11 +02:00
Erik Montnemery c5d0c392a9
Don't resolve default stt engine in assist pipelines (#91936)
* Don't resolve default stt engine in assist pipelines

* Apply suggestion from code review

* Add tests

* Tweak

* Add test

* Improve test coverage
2023-04-24 13:37:13 +02:00
Paulus Schoutsen a203149133
Allow entity names for STT entities (#91932)
* Allow entity names for STT entities

* Fix tests
2023-04-23 23:06:34 -04:00
Paulus Schoutsen f4df0ca50a
Assist pipeline to use configured values (#91901)
* Assist pipeline to use configured values

* Include voice in TTS-START event

* Use correct tts language var

* More vars

* Apply suggestions from code review

* Update

---------

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2023-04-23 12:48:11 -04:00
Paulus Schoutsen 1eef4af493
Use configured voice in TTS output for assist pipeline (#91878) 2023-04-22 22:01:32 -04:00