Simplify ecovacs unload and register teardown before initialize (#163350)

This commit is contained in:
Robert Resch
2026-02-18 23:32:39 +01:00
committed by GitHub
parent c7276621eb
commit 3b7b3454d8

View File

@@ -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: