From d1860105fdac97fadc3113571bf2d0fe310d52db Mon Sep 17 00:00:00 2001 From: Robbe-B <103053873+Robbe-B@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:59:32 +0100 Subject: [PATCH] Fix disconnected stoves, due to empty serial number --- custom_components/maestro_mcz/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/maestro_mcz/__init__.py b/custom_components/maestro_mcz/__init__.py index 3e0ab63..fde4a96 100644 --- a/custom_components/maestro_mcz/__init__.py +++ b/custom_components/maestro_mcz/__init__.py @@ -54,7 +54,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: stove:MaestroStove = stove coordinator = MczCoordinator(hass, stove, pollling_interval) await coordinator.async_config_entry_first_refresh() - if(coordinator.maestroapi.Status.sm_sn): #avoid adding a disconnected stove without serial number + if(coordinator.maestroapi.UniqueCode): #avoid adding a disconnected stove without serial number stoveList.append(coordinator) hass.data[DOMAIN][entry.entry_id] = stoveList @@ -113,7 +113,7 @@ def maestroapi(self) -> MaestroStove: def get_device_info(self) -> DeviceInfo: return DeviceInfo( - identifiers={(DOMAIN, self._maestroapi.Status.sm_sn)}, + identifiers={(DOMAIN, self._maestroapi.UniqueCode)}, name=self._maestroapi.Name, manufacturer=MANUFACTURER, model=self._maestroapi.Model.model_name,