diff --git a/custom_components/vivint/__init__.py b/custom_components/vivint/__init__.py index 06809e4..6b70b5b 100644 --- a/custom_components/vivint/__init__.py +++ b/custom_components/vivint/__init__.py @@ -126,10 +126,7 @@ def async_on_device_event(event_type: str, viv_device: VivintDevice) -> None: ) ) - for platform in PLATFORMS: - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(entry, platform) - ) + hass.config_entries.async_setup_platforms(entry, PLATFORMS) # Check for devices that no longer exist and remove them stored_devices = device_registry.async_entries_for_config_entry( @@ -157,14 +154,7 @@ def async_on_device_event(event_type: str, viv_device: VivintDevice) -> None: async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry): """Unload config entry.""" - unload_ok = all( - await asyncio.gather( - *[ - hass.config_entries.async_forward_entry_unload(entry, platform) - for platform in PLATFORMS - ] - ) - ) + unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) hub: VivintHub = hass.data[DOMAIN][entry.entry_id] await hub.disconnect() diff --git a/custom_components/vivint/manifest.json b/custom_components/vivint/manifest.json index c4de1ce..40e6e52 100644 --- a/custom_components/vivint/manifest.json +++ b/custom_components/vivint/manifest.json @@ -1,12 +1,12 @@ { "domain": "vivint", "name": "Vivint", - "version": "2021.12.0", + "version": "2022.1.0", "config_flow": true, "documentation": "https://github.com/natekspencer/hacs-vivint", "issue_tracker": "https://github.com/natekspencer/hacs-vivint/issues", "requirements": [ - "vivintpy==2021.12.0" + "vivintpy==2022.1.0" ], "dependencies": [ "ffmpeg"