From 919086aaf56f2a09e7e494421cf08ba3cf63c38d Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 11 Aug 2026 21:04:59 -0700 Subject: [PATCH] fix: let a water heater's state be its operation mode WaterHeaterEntity.state returns current_operation. PoolWaterHeater overrode it to return on/idle/off, values that are never members of operation_list, so the frontend's water-heater-operation-modes feature could not resolve a selection: it reads the entity state and matches it against operation_list. The active heater therefore never highlighted whenever one was assigned, while an unheated body highlighted "off" correctly, which reads as the control being backwards. Nothing is lost by removing the override. HeaterBinarySensor already publishes the same predicate the override encoded (body ON, heater assigned to this body, HTMODE non-zero), and STATUS and HTMODE remain exposed as attributes on the entity. The former "idle" case is now the operation mode reading as the heater's name while that binary sensor reads off. BREAKING CHANGE: automations that test a water_heater entity for the states "on" or "idle" need to move to the heater's binary sensor. --- custom_components/intellicenter/water_heater.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/custom_components/intellicenter/water_heater.py b/custom_components/intellicenter/water_heater.py index 039de58..45a2a3c 100644 --- a/custom_components/intellicenter/water_heater.py +++ b/custom_components/intellicenter/water_heater.py @@ -8,7 +8,7 @@ WaterHeaterEntityFeature, ) from homeassistant.config_entries import ConfigEntry -from homeassistant.const import ATTR_TEMPERATURE, STATE_IDLE, STATE_OFF, STATE_ON +from homeassistant.const import ATTR_TEMPERATURE, STATE_OFF from homeassistant.helpers.restore_state import RestoreEntity from homeassistant.core import HomeAssistant @@ -104,16 +104,6 @@ def extra_state_attributes(self) -> Optional[dict[str, Any]]: return state_attributes - @property - def state(self) -> str: - """Return the current state.""" - status = self._poolObject[STATUS_ATTR] - heater = self._poolObject[HEATER_ATTR] - if status == "OFF" or heater == NULL_OBJNAM: - return STATE_OFF - htmode = self._poolObject[HTMODE_ATTR] - return STATE_ON if htmode != "0" else STATE_IDLE - @property def unique_id(self): """Return a unique ID."""