Show proper name on Airzone errors (#102997)

* airzone: fix showing None on errors

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: use entity_id on erros/logs

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
Álvaro Fernández Rojas 2023-10-30 11:03:34 +01:00 committed by GitHub
parent 9952eed671
commit ba7dbc5927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -208,7 +208,9 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):
await self._async_update_hvac_params(params)
if slave_raise:
raise HomeAssistantError(f"Mode can't be changed on slave zone {self.name}")
raise HomeAssistantError(
f"Mode can't be changed on slave zone {self.entity_id}"
)
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""

View file

@ -118,9 +118,7 @@ class AirzoneHotWaterEntity(AirzoneEntity):
try:
await self.coordinator.airzone.set_dhw_parameters(_params)
except AirzoneError as error:
raise HomeAssistantError(
f"Failed to set dhw {self.name}: {error}"
) from error
raise HomeAssistantError(f"Failed to set DHW: {error}") from error
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())
@ -205,7 +203,7 @@ class AirzoneZoneEntity(AirzoneEntity):
await self.coordinator.airzone.set_hvac_parameters(_params)
except AirzoneError as error:
raise HomeAssistantError(
f"Failed to set zone {self.name}: {error}"
f"Failed to set zone {self.entity_id}: {error}"
) from error
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())