Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion custom_components/daikinskyport/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why these are hard coded values? I haven't looked into humidity control in HA. What are these used for?

_attr_name = None
_attr_has_entity_name = True
_enable_turn_on_off_backwards_compatibility = False
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Comment on lines +484 to +485
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why this "out of pattern" conditional and not amend the flag to the full SUPPORT_FLAGS list in line 216-222?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The goal is only to advertise the feature if the unit is advertising a humidifier capability, since not all units have one integrated to them.

return features

@property
def name(self):
Expand Down Expand Up @@ -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)."""
Expand Down