No side effects in zha climate properties (#35942)

* No side effects in properties

* Remove logging
This commit is contained in:
Alexei Chetroi 2020-05-22 09:24:42 -04:00 committed by GitHub
parent 7035a6da9f
commit be416d9fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,8 +234,6 @@ class Thermostat(ZhaEntity, ClimateEntity):
self._thrm.pi_heating_demand is None self._thrm.pi_heating_demand is None
and self._thrm.pi_cooling_demand is None and self._thrm.pi_cooling_demand is None
): ):
self.debug("Running mode: %s", self._thrm.running_mode)
self.debug("Running state: %s", self._thrm.running_state)
running_state = self._thrm.running_state running_state = self._thrm.running_state
if running_state is None: if running_state is None:
return None return None
@ -261,13 +259,7 @@ class Thermostat(ZhaEntity, ClimateEntity):
@property @property
def hvac_mode(self) -> Optional[str]: def hvac_mode(self) -> Optional[str]:
"""Return HVAC operation mode.""" """Return HVAC operation mode."""
try: return SYSTEM_MODE_2_HVAC.get(self._thrm.system_mode)
return SYSTEM_MODE_2_HVAC[self._thrm.system_mode]
except KeyError:
self.error(
"can't map 'system_mode: %s' to a HVAC mode", self._thrm.system_mode
)
return None
@property @property
def hvac_modes(self) -> Tuple[str, ...]: def hvac_modes(self) -> Tuple[str, ...]: