Show proper name on Airzone Cloud errors (#102998)
* airzone_cloud: fix showing None on errors Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> * airzone_cloud: use entity_id on errors/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:
parent
8acc45d482
commit
9952eed671
2 changed files with 15 additions and 9 deletions
|
@ -386,4 +386,6 @@ class AirzoneZoneClimate(AirzoneZoneEntity, AirzoneDeviceClimate):
|
|||
await self._async_update_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}"
|
||||
)
|
||||
|
|
|
@ -80,14 +80,14 @@ class AirzoneAidooEntity(AirzoneEntity):
|
|||
|
||||
async def _async_update_params(self, params: dict[str, Any]) -> None:
|
||||
"""Send Aidoo parameters to Cloud API."""
|
||||
_LOGGER.debug("aidoo=%s: update_params=%s", self.name, params)
|
||||
_LOGGER.debug("aidoo=%s: update_params=%s", self.entity_id, params)
|
||||
try:
|
||||
await self.coordinator.airzone.api_set_aidoo_id_params(
|
||||
self.aidoo_id, params
|
||||
)
|
||||
except AirzoneCloudError as error:
|
||||
raise HomeAssistantError(
|
||||
f"Failed to set {self.name} params: {error}"
|
||||
f"Failed to set {self.entity_id} params: {error}"
|
||||
) from error
|
||||
|
||||
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())
|
||||
|
@ -122,14 +122,14 @@ class AirzoneGroupEntity(AirzoneEntity):
|
|||
|
||||
async def _async_update_params(self, params: dict[str, Any]) -> None:
|
||||
"""Send Group parameters to Cloud API."""
|
||||
_LOGGER.debug("group=%s: update_params=%s", self.name, params)
|
||||
_LOGGER.debug("group=%s: update_params=%s", self.entity_id, params)
|
||||
try:
|
||||
await self.coordinator.airzone.api_set_group_id_params(
|
||||
self.group_id, params
|
||||
)
|
||||
except AirzoneCloudError as error:
|
||||
raise HomeAssistantError(
|
||||
f"Failed to set {self.name} params: {error}"
|
||||
f"Failed to set {self.entity_id} params: {error}"
|
||||
) from error
|
||||
|
||||
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())
|
||||
|
@ -164,14 +164,18 @@ class AirzoneInstallationEntity(AirzoneEntity):
|
|||
|
||||
async def _async_update_params(self, params: dict[str, Any]) -> None:
|
||||
"""Send Installation parameters to Cloud API."""
|
||||
_LOGGER.debug("installation=%s: update_params=%s", self.name, params)
|
||||
_LOGGER.debug(
|
||||
"installation=%s: update_params=%s",
|
||||
self.entity_id,
|
||||
params,
|
||||
)
|
||||
try:
|
||||
await self.coordinator.airzone.api_set_installation_id_params(
|
||||
self.inst_id, params
|
||||
)
|
||||
except AirzoneCloudError as error:
|
||||
raise HomeAssistantError(
|
||||
f"Failed to set {self.name} params: {error}"
|
||||
f"Failed to set {self.entity_id} params: {error}"
|
||||
) from error
|
||||
|
||||
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())
|
||||
|
@ -267,12 +271,12 @@ class AirzoneZoneEntity(AirzoneEntity):
|
|||
|
||||
async def _async_update_params(self, params: dict[str, Any]) -> None:
|
||||
"""Send Zone parameters to Cloud API."""
|
||||
_LOGGER.debug("zone=%s: update_params=%s", self.name, params)
|
||||
_LOGGER.debug("zone=%s: update_params=%s", self.entity_id, params)
|
||||
try:
|
||||
await self.coordinator.airzone.api_set_zone_id_params(self.zone_id, params)
|
||||
except AirzoneCloudError as error:
|
||||
raise HomeAssistantError(
|
||||
f"Failed to set {self.name} params: {error}"
|
||||
f"Failed to set {self.entity_id} params: {error}"
|
||||
) from error
|
||||
|
||||
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())
|
||||
|
|
Loading…
Add table
Reference in a new issue