Skip to content

Commit

Permalink
Fix current state in climate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tpacri authored Jan 11, 2025
1 parent 892b283 commit 3dae4c4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions custom_components/multizone_generic_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,7 @@ def current_temperature(self):
@property
def hvac_mode(self):
"""Return current operation."""
#_LOGGER.warning("hvac_mode %s", self._hvac_mode)
return self._hvac_mode

@property
Expand All @@ -881,12 +882,16 @@ def hvac_action(self):
Need to be one of CURRENT_HVAC_*.
"""
if self._hvac_mode == HVACMode.OFF:
#_LOGGER.warning("hvac_action HVACAction.OFF")
return HVACAction.OFF
if not self._is_device_active:
#_LOGGER.warning("hvac_action HVACAction.IDLE")
return HVACAction.IDLE
if self.ac_mode:
return HVACAction.COOL
return HVACAction.HEAT
#_LOGGER.warning("hvac_action HVACAction.COOL")
return HVACAction.COOLING
#_LOGGER.warning("hvac_action HVACAction.HEATING")
return HVACAction.HEATING

@property
def target_temperature(self):
Expand All @@ -897,6 +902,7 @@ def target_temperature(self):
@property
def hvac_modes(self):
"""List of available operation modes."""
#_LOGGER.warning("hvac_modes %s", ", ".join(self._hvac_list))
return self._hvac_list

@property
Expand All @@ -914,6 +920,7 @@ def preset_modes(self):

async def async_set_hvac_mode(self, hvac_mode):
"""Set hvac mode."""
#_LOGGER.warning("async_set_hvac_mode %s", hvac_mode)
if hvac_mode == HVACMode.HEAT:
self._hvac_mode = HVACMode.HEAT
await self._async_control_heating(force=True)
Expand Down

0 comments on commit 3dae4c4

Please sign in to comment.