From e1dade69e14b1f540bc6742b6c0d5c1472df5d0d Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:29:03 +1300 Subject: [PATCH] ESPHome: Pass through wake_word_phrase from on-device microWakeWord (#111585) * ESPHome: Pass through wake_word_phrase from on-device microWakeWord * Bump aioesphomeapi to 23.0.0 --- homeassistant/components/esphome/manager.py | 2 ++ homeassistant/components/esphome/manifest.json | 2 +- homeassistant/components/esphome/voice_assistant.py | 2 ++ requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/esphome/manager.py b/homeassistant/components/esphome/manager.py index a69216ec590..bd01bea8795 100644 --- a/homeassistant/components/esphome/manager.py +++ b/homeassistant/components/esphome/manager.py @@ -331,6 +331,7 @@ class ESPHomeManager: conversation_id: str, flags: int, audio_settings: VoiceAssistantAudioSettings, + wake_word_phrase: str | None, ) -> int | None: """Start a voice assistant pipeline.""" if self.voice_assistant_udp_server is not None: @@ -354,6 +355,7 @@ class ESPHomeManager: conversation_id=conversation_id or None, flags=flags, audio_settings=audio_settings, + wake_word_phrase=wake_word_phrase, ), "esphome.voice_assistant_udp_server.run_pipeline", ) diff --git a/homeassistant/components/esphome/manifest.json b/homeassistant/components/esphome/manifest.json index 78c9f37fcbf..a1841306f0c 100644 --- a/homeassistant/components/esphome/manifest.json +++ b/homeassistant/components/esphome/manifest.json @@ -16,7 +16,7 @@ "iot_class": "local_push", "loggers": ["aioesphomeapi", "noiseprotocol", "bleak_esphome"], "requirements": [ - "aioesphomeapi==22.1.0", + "aioesphomeapi==23.0.0", "esphome-dashboard-api==1.2.3", "bleak-esphome==1.0.0" ], diff --git a/homeassistant/components/esphome/voice_assistant.py b/homeassistant/components/esphome/voice_assistant.py index 7c5c74d58ee..94ba957e6f7 100644 --- a/homeassistant/components/esphome/voice_assistant.py +++ b/homeassistant/components/esphome/voice_assistant.py @@ -237,6 +237,7 @@ class VoiceAssistantUDPServer(asyncio.DatagramProtocol): conversation_id: str | None, flags: int = 0, audio_settings: VoiceAssistantAudioSettings | None = None, + wake_word_phrase: str | None = None, ) -> None: """Run the Voice Assistant pipeline.""" if audio_settings is None or audio_settings.volume_multiplier == 0: @@ -273,6 +274,7 @@ class VoiceAssistantUDPServer(asyncio.DatagramProtocol): tts_audio_output=tts_audio_output, start_stage=start_stage, wake_word_settings=WakeWordSettings(timeout=5), + wake_word_phrase=wake_word_phrase, audio_settings=AudioSettings( noise_suppression_level=audio_settings.noise_suppression_level, auto_gain_dbfs=audio_settings.auto_gain, diff --git a/requirements_all.txt b/requirements_all.txt index 93c64948bc9..3b853ebeca6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -245,7 +245,7 @@ aioelectricitymaps==0.4.0 aioemonitor==1.0.5 # homeassistant.components.esphome -aioesphomeapi==22.1.0 +aioesphomeapi==23.0.0 # homeassistant.components.flo aioflo==2021.11.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index f24acde7b3d..3ca0fdc8f73 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -224,7 +224,7 @@ aioelectricitymaps==0.4.0 aioemonitor==1.0.5 # homeassistant.components.esphome -aioesphomeapi==22.1.0 +aioesphomeapi==23.0.0 # homeassistant.components.flo aioflo==2021.11.0