Commit Graph

63 Commits (reolink_mock_reset)

Author SHA1 Message Date
Marc Mueller d1b85cd452
Fix voip test RuntimeWarning (#144519) 2025-05-09 00:26:43 +02:00
Jamin 14f967cdd0
Improve Voip pipeline stability (#137620)
* Improve Voip pipeline stability

It appears the pipeline is being unexpectedly cancelled in some
instances. In order to mitigate this issue hang ups will be detected
using a separate task rather than relying on timeouts in the STT read
method. Also reading STT events will be retried once if it is cancelled.
The pipeline will also catch and log any CancelledErrors to help with
further debugging.

* Update Voip tests

* Remove unnecessary changes

Remove unnecessary logging and cancelled error handling in wyoming STT.

* Remove comment about clearing system prompt

The test no longer checks for clearing the system prompt. Since that
logic exists completely in the assist_satellite component I think it is
reasonable to only test that logic in the unit tests for that component.

* Re-raise cancellation

Re-raise CancelledError if the current task is cancelling in the check hangup task

Co-authored-by: J. Nick Koston <nick@koston.org>

* Re-raise CancelledError in pipeline as well

* Fix formatting issue

* Remove unnecessary logging

* Add MockResultStream import to tests

This was presumably missed while merging

* Cancel check hangup task on disconnect

* Add myself as codeowner for VoIP

* Update CODEOWNERS

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2025-05-05 20:25:52 -04:00
Paulus Schoutsen 8aa30b0ccb
Migrate VoIP to use Assist Pipeline TTS tokens (#139671)
* Migrate VoIP to use pipeline token

* migrate announcements to use TTS token
2025-04-22 10:24:24 -04:00
Simone Chemelli 5816a24577
Cleanup snapshot call in tests (#142750) 2025-04-11 17:21:12 +02:00
Paulus Schoutsen f32bb1a318
Assist satellite to use TTS tokens for announcements (#140336)
* Migrate Assist Satellite to use token

* Fix tests

* Fix tests
2025-03-13 08:36:38 -05:00
Paulus Schoutsen c51a2317e1
Add timer support to VoIP (#139763) 2025-03-04 15:48:10 +01:00
Paulus Schoutsen 8a97c2bfca
VoIP block non-TTS announcements (#139658)
* VoIP block non-TTS announcements

* Migrate VoIP to use pipeline token
2025-03-04 08:02:58 -05:00
Jamin 97a8f24f8e
Allow specifying SIP username for outgoing calls (#137059)
* Allow specifying SIP username for outgoing calls

Allow configuring a SIP username to be sent in outgoing call requests to
identify the home assistant source endpoint.

* Remove advanced options section

* Add test for removing user

* Allow unsetting SIP user

Make previous SIP user value a suggested value rather than default to
allow unsetting by submitting an empty value in the form.

* Remove unnecessary checks

Remove user check from main flow and remove none or empty check.
2025-02-10 19:24:59 -05:00
Michael Hansen 28edbdc107
Clear extra system prompt on start_conversation error (#137254)
* Clear extra system prompt on start_conversation error

* Update homeassistant/components/assist_satellite/entity.py

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

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2025-02-03 12:07:45 -05:00
Paulus Schoutsen 427c437a68
Add start_conversation service to Assist Satellite (#134921)
* Add start_conversation service to Assist Satellite

* Fix tests

* Implement start_conversation in voip

* Update homeassistant/components/assist_satellite/entity.py

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
2025-01-29 21:32:10 -05:00
Michael Hansen d206553a0d
Cancel call if user does not pick up (#136858) 2025-01-29 13:52:32 -05:00
Michael Hansen 64cda8cdb8
Add VoIP announce (#136781)
* Implement async_announce for VoIP

* Add tests

* Add network to voip dependencies
2025-01-28 19:32:08 -05:00
Michael Hansen 3984565084
Bump voip-utils to 0.3.0 (#136648) 2025-01-27 11:42:00 -06:00
Paulus Schoutsen 22e0b0e9a7
Voip migrate entities (#136140)
* Migrate VoIP entities

* Revert device name to host again
2025-01-21 11:12:30 -06:00
Jamin 79ee2e954b
Use SIP URI for VoIP device identifier (#135603)
* Use SIP URI for VoIP device identifier

Use the SIP URI instead of just host/IP address to identify VoIP
devices. This will allow calls initiating from Home Assistant to the
device as well as allows devices connecting through a PBX to be uniquely
identified.

* Add tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2025-01-15 20:59:58 -05:00
Michael Hansen af5574f71c
Bump voip-utils (#132110)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-12-03 14:08:55 +01:00
epenet 906cecf087
Cleanup unused snapshots (#128549)
* Cleanup unused snapshots

* Cleanup a few more

* Cleanup systemmonitor

* Cleanup voip
2024-10-17 10:41:57 +02:00
Michael Hansen bd4f3b0553
Change Assist satellite state names (#126926)
* Change state names

* Update homeassistant/components/assist_satellite/strings.json

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-27 11:11:23 -04:00
Paulus Schoutsen 471c68f653
Update the Selected Pipeline entity name (#126845) 2024-09-26 20:38:51 +02:00
Michael Hansen 9db5b481be
Fix ESPHome and VoIP Assist satellite entity names (#126229)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-09-26 20:22:09 +02:00
Michael Hansen 86f8901c96
Fix pipeline restart in VoIP (#126668) 2024-09-24 21:24:42 +02:00
Erik Montnemery c96d4991b9
Add issue asking users to disable VoIP call_in_progress binary sensor (#126504)
* Add issue asking users to disable VoIP call_in_progress binary sensor

* Add tests

* Add files

* Update homeassistant/components/voip/binary_sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Fix test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-24 11:46:43 +02:00
epenet 02cb6a6af7
Force root import of references from other components (#125816)
* Force root import of references from other components

* Improve

* Adjust

* Tweak exceptions

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Another

* Adjust

* More

* Ignore violations in test

* Improve
2024-09-16 11:28:42 +02:00
epenet 7df224f382
Use root import in assist_satellite imports (#126025) 2024-09-16 10:05:34 +02:00
Erik Montnemery 662a30ffaf
Disable voip call_in_progress binary sensor (#125812) 2024-09-12 13:34:11 -05:00
Michael Hansen 9651072103
Fix audio format for VoIP (#125785)
Fix audio format
2024-09-11 20:57:47 -04:00
Paulus Schoutsen 6976a66758
Migrate VoIP to use assist satellite (#125381)
* Migrate VoIP to assist satellite

* Fix flaky test
2024-09-06 09:11:51 -05:00
epenet ba54a19d4b
Simplify mock_tts_cache_dir_autouse fixture (#123783) 2024-08-13 18:01:06 +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
epenet 3e9d25f81d
Add missing argument type hints to component tests (#119671) 2024-06-14 09:26:46 +02:00
epenet fb51163075
Move socket_enabled fixture to decorator (#118847) 2024-06-06 17:27:38 +02:00
epenet f178467b0e
Add type hints for TTS test fixtures (#118704) 2024-06-03 17:43:18 +02:00
epenet a59621bf9e
Add more type hints to pylint plugin (#118319) 2024-05-28 18:37:38 +02:00
epenet 9204ccfa17
Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker f3ba713289
Use FlowResultType enum in config flow tests N-Z (#114682)
Use FlowResultType enum in config flow tests
2024-04-03 09:53:20 +02:00
Joost Lekkerkerker 2ef0521d3d
Use is in enum comparison in config flow tests U-Z (#114677)
* Use right enum expression U-Z

* Fix
2024-04-02 23:09:56 +02: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
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller 87165c0d6e
Add empty line after module docstring [tests t-z] (#112712) 2024-03-08 14:44:56 +01:00
Marc Mueller 8b0c9d3d18
Use builtin TimeoutError [t-z] (#109683) 2024-02-05 12:20:36 +01: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 a894146cee
Fix TTS streaming for VoIP (#104620)
* Use wav instead of raw tts audio in voip

* More tests

* Use mock TTS dir
2023-11-29 12:07:22 -05: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
Marc Mueller 8b0fdd6fd2
Use asyncio.timeout [s-z] (#98452) 2023-08-15 14:34:18 +02: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 0f08e6699c
Add VAD sensitivity to ESPHome (#95283)
* Change to "finished speaking detection"

* Add select entity to ESPHome for finished speaking detection

* Fix entity name

* Use vad select in stt stream

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-06-26 16:47:32 -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 cd330a2740
Pass device ID to conversation input (#93867) 2023-05-31 16:56:12 -04:00
epenet 6836e15d98
Add type hints to tests (#92477) 2023-05-04 11:25:35 +02:00
Michael Hansen aa78962a9a
Pass OPUS payload ID through VoIP (#92421) 2023-05-03 19:43:14 +02:00