Skip to content

Commit

Permalink
fix deprecated entry setup and destruction.
Browse files Browse the repository at this point in the history
  • Loading branch information
gluap committed Jul 7, 2024
1 parent a27915f commit 6c34e5a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions custom_components/duofern/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
unsetupDevice(hass, duofernId)

for component in DUOFERN_COMPONENTS:
hass.async_create_task(
hass.config_entries.async_forward_entry_unload(config_entry, component)
)
await hass.config_entries.async_forward_entry_unload(config_entry, component)



newstick = DuofernStickThreaded(serial_port=stick.port, system_code=stick.system_code,
Expand Down Expand Up @@ -132,9 +131,7 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Setup the Duofern Config entries (entities, devices, etc...)"""
for component in DUOFERN_COMPONENTS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, component)
)
await hass.config_entries.async_forward_entry_setup(entry, component)

return True

Expand Down

0 comments on commit 6c34e5a

Please sign in to comment.