Skip to content

Commit

Permalink
Fixed obsolete calls
Browse files Browse the repository at this point in the history
Fixed async_forward_entry_setup and async_forward_entry_unload calls
  • Loading branch information
plmilord authored Aug 3, 2024
1 parent 5187fbb commit 2c31124
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
18 changes: 3 additions & 15 deletions custom_components/spaclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ async def async_setup_entry(hass, config_entry):
hass.loop.create_task(spa.keep_alive_call())
hass.loop.create_task(spa.read_all_msg())

for component in SPACLIENT_COMPONENTS:
hass.async_create_task(hass.config_entries.async_forward_entry_setup(config_entry, component))
await hass.config_entries.async_forward_entry_setups(config_entry, SPACLIENT_COMPONENTS)

spa.print_variables()
return True
Expand All @@ -91,22 +90,11 @@ async def async_setup_entry(hass, config_entry):
async def async_unload_entry(hass, config_entry) -> bool:
"""Unload a config entry."""

unload_ok = all(
await asyncio.gather(
*[
hass.config_entries.async_forward_entry_unload(config_entry, component)
for component in SPACLIENT_COMPONENTS
]
)
)

hass.data[DOMAIN][config_entry.entry_id][DATA_LISTENER]:listener()

if unload_ok:
if unload_ok := await hass.config_entries.async_unload_platforms(config_entry, SPACLIENT_COMPONENTS):
hass.data[DOMAIN].pop(config_entry.entry_id)
return True

return False
return unload_ok


async def update_listener(hass, config_entry):
Expand Down
2 changes: 1 addition & 1 deletion custom_components/spaclient/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://github.com/plmilord/Hass.io-custom-component-spaclient",
"iot_class": "local_push",
"issue_tracker": "https://github.com/plmilord/Hass.io-custom-component-spaclient/issues",
"version": "3.0"
"version": "3.1"
}

0 comments on commit 2c31124

Please sign in to comment.