Skip to content

Commit

Permalink
Fix disconnected stoves, due to empty serial number
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbe-B committed Jan 2, 2024
1 parent 2aedceb commit d186010
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/maestro_mcz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d186010

Please sign in to comment.