{"record":{"id":"4e8811b7b8335105","repo":"home-assistant/core","slug":"err","errorCode":null,"errorMessage":"{err}","messagePattern":"\\{err\\}","errorType":"exception","errorClass":"HomeAssistantError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/advantage_air/entity.py","lineNumber":37,"sourceCode":"    _attr_has_entity_name = True\n\n    def __init__(self, coordinator: AdvantageAirCoordinator) -> None:\n        \"\"\"Initialize common aspects of an Advantage Air entity.\"\"\"\n        super().__init__(coordinator)\n        self._attr_unique_id: str = self.coordinator.data[\"system\"][\"rid\"]\n\n    def update_handle_factory(self, func, *keys):\n        \"\"\"Return the provided API function wrapped.\n\n        Adds an error handler and coordinator refresh, and presets keys.\n        \"\"\"\n\n        async def update_handle(*values):\n            try:\n                if await func(*keys, *values):\n                    await self.coordinator.async_request_refresh()\n            except ApiError as err:\n                raise HomeAssistantError(err) from err\n\n        return update_handle\n\n\nclass AdvantageAirAcEntity(AdvantageAirEntity):\n    \"\"\"Parent class for Advantage Air AC Entities.\"\"\"\n\n    def __init__(self, coordinator: AdvantageAirCoordinator, ac_key: str) -> None:\n        \"\"\"Initialize common aspects of an Advantage Air ac entity.\"\"\"\n        super().__init__(coordinator)\n\n        self.ac_key: str = ac_key\n        self._attr_unique_id += f\"-{ac_key}\"\n\n        self._attr_device_info = DeviceInfo(\n            via_device_id=dr.async_get_device_id_by_identifier(\n                self.coordinator.hass,\n                (DOMAIN, self.coordinator.data[\"system\"][\"rid\"]),","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/advantage_air/entity.py#L19-L55","documentation":"HomeAssistantError raised inside update_handle (built by AdvantageAirEntity.update_handle_factory) when the wrapped API func(*keys, *values) raises ApiError. Every Advantage Air entity command (set temperature, fan speed, zone open/close, lights, etc.) goes through this wrapper, so any controller-side failure during a command surfaces here and also skips the coordinator refresh that only runs on success.","triggerScenarios":"Any entity action — climate.set_temperature, cover position on a zone damper, light/switch on the controller, fan mode — issued while the controller is offline or rejects the request; ApiError propagates and is re-raised as HomeAssistantError(err).","commonSituations":"Controller briefly offline when an automation fires; stale entity state after HA restart letting the UI send out-of-range values the controller rejects; network flakiness between HA and the AC unit.","solutions":["Confirm the controller is online (its web UI loads) and retry the action.","Read the wrapped ApiError text — it states whether it was a transport failure or a rejected value (e.g. out-of-range setpoint).","For recurring automation failures, add a condition checking the integration/coordinator's last_update_success before issuing commands.","If the value was rejected, correct the automation to send values within the controller's supported ranges.","Restart the controller if it consistently rejects valid commands — a known recovery for wedged local APIs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from homeassistant.exceptions import HomeAssistantError\n\ntry:\n    await hass.services.async_call(\n        \"climate\", \"set_temperature\",\n        {\"entity_id\": entity_id, \"temperature\": 22.0},\n    )\nexcept HomeAssistantError as err:\n    # wraps the controller's ApiError; check transport vs rejected value\n    _LOGGER.warning(\"Advantage Air command failed: %s\", err)","preventionTips":["Gate automations on the entity being available / coordinator.last_update_success.","Send only in-range setpoints and valid fan/zone values accepted by the controller.","Retry once after a short delay — brief controller drops are common."],"tags":["homeassistant","advantage-air","entity","api-error"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}