diff --git a/homeassistant/components/wiz/__init__.py b/homeassistant/components/wiz/__init__.py index ddf324278cf..ce5d92c5f62 100644 --- a/homeassistant/components/wiz/__init__.py +++ b/homeassistant/components/wiz/__init__.py @@ -81,6 +81,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: hass, _LOGGER, cooldown=REQUEST_REFRESH_DELAY, immediate=False ), ) + + await bulb.start_push(lambda _: coordinator.async_set_updated_data(None)) await coordinator.async_config_entry_first_refresh() hass.data.setdefault(DOMAIN, {})[entry.entry_id] = WizData( @@ -93,5 +95,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Unload a config entry.""" if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS): - hass.data[DOMAIN].pop(entry.entry_id) + data: WizData = hass.data[DOMAIN].pop(entry.entry_id) + await data.bulb.async_close() return unload_ok diff --git a/homeassistant/components/wiz/manifest.json b/homeassistant/components/wiz/manifest.json index 773c0ff0e6e..90a6347dbc5 100644 --- a/homeassistant/components/wiz/manifest.json +++ b/homeassistant/components/wiz/manifest.json @@ -8,7 +8,7 @@ ], "dependencies": ["network"], "documentation": "https://www.home-assistant.io/integrations/wiz", - "requirements": ["pywizlight==0.5"], - "iot_class": "local_polling", + "requirements": ["pywizlight==0.5.1"], + "iot_class": "local_push", "codeowners": ["@sbidy"] } diff --git a/requirements_all.txt b/requirements_all.txt index 3a5da629839..5e2c0ac5bda 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2051,7 +2051,7 @@ pywemo==0.7.0 pywilight==0.0.70 # homeassistant.components.wiz -pywizlight==0.5 +pywizlight==0.5.1 # homeassistant.components.xeoma pyxeoma==1.4.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c86988eb62a..bf0123fea98 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1276,7 +1276,7 @@ pywemo==0.7.0 pywilight==0.0.70 # homeassistant.components.wiz -pywizlight==0.5 +pywizlight==0.5.1 # homeassistant.components.zerproc pyzerproc==0.4.8