-
Notifications
You must be signed in to change notification settings - Fork 39
Add humidity control support to climate entity #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Comment on lines
+484
to
+485
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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): | ||
|
|
@@ -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).""" | ||
|
|
||
There was a problem hiding this comment.
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?