Add current humidity to zwave_js climate platform (#45857)

This commit is contained in:
Raman Gupta 2021-02-02 02:41:00 -06:00 committed by GitHub
parent 3ef7bd6b73
commit 8d9b66e23d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View file

@ -142,6 +142,12 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._current_humidity = self.get_zwave_value(
"Humidity",
command_class=CommandClass.SENSOR_MULTILEVEL,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._set_modes_and_presets()
def _setpoint_value(self, setpoint_type: ThermostatSetpointType) -> ZwaveValue:
@ -207,6 +213,11 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
return None
return HVAC_CURRENT_MAP.get(int(self._operating_state.value))
@property
def current_humidity(self) -> Optional[int]:
"""Return the current humidity level."""
return self._current_humidity.value if self._current_humidity else None
@property
def current_temperature(self) -> Optional[float]:
"""Return the current temperature."""