mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 00:03:16 +01:00
Simplify ecovacs unload and register teardown before initialize (#163350)
This commit is contained in:
@@ -38,12 +38,11 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
async def async_setup_entry(hass: HomeAssistant, entry: EcovacsConfigEntry) -> bool:
|
||||
"""Set up this integration using UI."""
|
||||
controller = EcovacsController(hass, entry.data)
|
||||
|
||||
entry.async_on_unload(controller.teardown)
|
||||
|
||||
await controller.initialize()
|
||||
|
||||
async def on_unload() -> None:
|
||||
await controller.teardown()
|
||||
|
||||
entry.async_on_unload(on_unload)
|
||||
entry.runtime_data = controller
|
||||
|
||||
async def _async_wait_connect(device: VacBot) -> None:
|
||||
|
||||
Reference in New Issue
Block a user