Skip to content

Commit

Permalink
Close existing UDP server for ESPHome voice assistant (#101845)
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam authored and frenck committed Oct 12, 2023
1 parent ffe6010 commit 3b13c91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion homeassistant/components/esphome/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,10 @@ async def _handle_pipeline_start(
) -> int | None:
"""Start a voice assistant pipeline."""
if self.voice_assistant_udp_server is not None:
return None
_LOGGER.warning("Voice assistant UDP server was not stopped")
self.voice_assistant_udp_server.stop()
self.voice_assistant_udp_server.close()
self.voice_assistant_udp_server = None

hass = self.hass
self.voice_assistant_udp_server = VoiceAssistantUDPServer(
Expand Down

0 comments on commit 3b13c91

Please sign in to comment.