From 4354807286541554e58207c0c2af0d041bd4d7c1 Mon Sep 17 00:00:00 2001 From: Thijs W Date: Fri, 22 Sep 2023 19:14:54 +0200 Subject: [PATCH] Fix unload in services.py Fixes #482 --- services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services.py b/services.py index 8ce4c42..0786283 100644 --- a/services.py +++ b/services.py @@ -677,7 +677,7 @@ async def async_setup_services( # noqa: C901 async def async_cleanup_services( hass: HomeAssistant): """Cleanup all Huawei Solar service (if all config entries unloaded)""" - if len(hass.data[DOMAIN] == 1): + if len(hass.data[DOMAIN]) == 1: for service in ALL_SERVICES: if hass.services.has_service(DOMAIN, service): - hass.services.async_remove(DOMAIN, service) \ No newline at end of file + hass.services.async_remove(DOMAIN, service)