From dce6c72116ca30206e546d614a83245e98ec6500 Mon Sep 17 00:00:00 2001 From: jjlawren Date: Wed, 10 Aug 2022 09:19:48 -0500 Subject: [PATCH] Fix integration reload Fixes #33 --- custom_components/sonos_cloud/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/sonos_cloud/__init__.py b/custom_components/sonos_cloud/__init__.py index 3f0a844..62ac479 100644 --- a/custom_components/sonos_cloud/__init__.py +++ b/custom_components/sonos_cloud/__init__.py @@ -38,7 +38,6 @@ async def async_setup(hass: HomeAssistant, config: dict[str, Any]) -> bool: """Set up the Sonos Cloud component.""" hass.data[DOMAIN] = {} - hass.data[DOMAIN][PLAYERS] = [] if DOMAIN not in config: return True @@ -61,6 +60,8 @@ async def async_setup(hass: HomeAssistant, config: dict[str, Any]) -> bool: async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up Sonos Cloud from a config entry.""" + hass.data[DOMAIN][PLAYERS] = [] + implementation = ( await config_entry_oauth2_flow.async_get_config_entry_implementation( hass, entry