From 1b60a7bf63f3a0223776046aefa8167b412778b8 Mon Sep 17 00:00:00 2001 From: aunefyren Date: Sun, 4 Feb 2024 16:55:23 +0100 Subject: [PATCH] Update config_flow.py --- custom_components/bluesound_alt/config_flow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/bluesound_alt/config_flow.py b/custom_components/bluesound_alt/config_flow.py index 28f4df7..96d0676 100644 --- a/custom_components/bluesound_alt/config_flow.py +++ b/custom_components/bluesound_alt/config_flow.py @@ -12,6 +12,7 @@ from homeassistant.const import ( CONF_HOST, CONF_NAME, + EVENT_HOMEASSISTANT_STOP, ) import homeassistant.helpers.config_validation as cv @@ -55,6 +56,7 @@ async def validate_input(hass: HomeAssistant, data: dict) -> dict[str, Any]: if len(data[CONF_NAME]) < 1: raise InvalidName + HomeAssistant.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, None) player = BluesoundPlayer(HomeAssistant, data[CONF_HOST], DEFAULT_PORT, data[CONF_NAME], None) result = await player.force_update_sync_status(None, raise_timeout=False) if result is not True: