Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disconnected stoves, due to empty serial number #84

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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