From e6a841fd30ecdce0115fde481e4a5c5e86028a58 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 26 Dec 2025 14:21:33 -0500 Subject: [PATCH] Add humidity control support to climate entity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Advertise existing set_humidity() via ClimateEntityFeature.TARGET_HUMIDITY - Only enable when ctSystemCapHumidification capability is present - Set humidity range to 25-65% (matching Daikin humidifier limits) - Update local state immediately after set_humidity call 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 Signed-off-by: Mohammed Naser --- custom_components/daikinskyport/climate.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/custom_components/daikinskyport/climate.py b/custom_components/daikinskyport/climate.py index c37f205..32d3c93 100644 --- a/custom_components/daikinskyport/climate.py +++ b/custom_components/daikinskyport/climate.py @@ -392,6 +392,8 @@ class Thermostat(ClimateEntity): _attr_precision = PRECISION_TENTHS _attr_temperature_unit = UnitOfTemperature.CELSIUS _attr_fan_modes = [FAN_AUTO, FAN_ON, FAN_LOW, FAN_MEDIUM, FAN_HIGH, FAN_SCHEDULE] + _attr_min_humidity = 25 + _attr_max_humidity = 65 _attr_name = None _attr_has_entity_name = True _enable_turn_on_off_backwards_compatibility = False @@ -405,6 +407,7 @@ def __init__(self, data, thermostat_index, thermostat): self._attr_unique_id = f"{self.thermostat['id']}-climate" self._cool_setpoint = self.thermostat["cspActive"] self._heat_setpoint = self.thermostat["hspActive"] + self._attr_target_humidity = self.thermostat.get("humSP") self._hvac_mode = DAIKIN_HVAC_TO_HASS[self.thermostat["mode"]] if DAIKIN_FAN_TO_HASS[self.thermostat["fanCirculate"]] == FAN_ON: self._fan_mode = DAIKIN_FAN_TO_HASS[self.thermostat["fanCirculateSpeed"] + 3] @@ -449,6 +452,7 @@ async def async_update(self): self.thermostat = self.data.daikinskyport.get_thermostat(self.thermostat_index) self._cool_setpoint = self.thermostat["cspActive"] self._heat_setpoint = self.thermostat["hspActive"] + self._attr_target_humidity = self.thermostat.get("humSP") self._hvac_mode = DAIKIN_HVAC_TO_HASS[self.thermostat["mode"]] if DAIKIN_FAN_TO_HASS[self.thermostat["fanCirculate"]] == FAN_ON: self._fan_mode = DAIKIN_FAN_TO_HASS[self.thermostat["fanCirculateSpeed"] + 3] @@ -476,7 +480,10 @@ def available(self): @property def supported_features(self): """Return the list of supported features.""" - return SUPPORT_FLAGS + features = SUPPORT_FLAGS + if self.thermostat.get("ctSystemCapHumidification", False): + features |= ClimateEntityFeature.TARGET_HUMIDITY + return features @property def name(self): @@ -770,6 +777,8 @@ def set_temperature(self, **kwargs): def set_humidity(self, humidity): """Set the humidity level.""" self.data.daikinskyport.set_humidity(self.thermostat_index, humidity) + self._attr_target_humidity = humidity + self.update_without_throttle = True def set_hvac_mode(self, hvac_mode): """Set HVAC mode (auto, auxHeatOnly, cool, heat, off)."""