Skip to content

Commit

Permalink
Merge pull request #220 from ocrease/issue177
Browse files Browse the repository at this point in the history
Fix for thermostats heating in standby
  • Loading branch information
MindrustUK authored Nov 29, 2024
2 parents d1a2c41 + ddaf1c7 commit 87fb4ee
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions custom_components/heatmiserneo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,6 @@ def extra_state_attributes(self):
def hvac_action(self):
# See: https://developers.home-assistant.io/docs/core/entity/climate/
"""The current HVAC action (heating, cooling)."""
if self.data.standby:
return HVACAction.OFF
if self.data.preheat_active:
return HVACAction.PREHEATING
if self.data.cool_on:
Expand All @@ -346,6 +344,10 @@ def hvac_action(self):
return HVACAction.HEATING
if self.data.fan_speed != "Off":
return HVACAction.FAN # Should fan be combined? Ie can you have fan on and other functions together?
if self.data.standby or self.data.away or self.data.holiday:
if self.data._data_.FROST_TEMP >= 127:
# If the frost protection temperature is not set, then the thermostat is truly off.
return HVACAction.OFF
return HVACAction.IDLE

@property
Expand Down Expand Up @@ -437,17 +439,26 @@ def supported_features(self):
@property
def target_temperature(self):
"""Return the temperature we try to reach."""
return float(self.data.target_temperature)
target = float(self.data.target_temperature)
if self.hvac_action != HVACAction.OFF and target < 255:
return target
return None

@property
def target_temperature_high(self):
"""Return the temperature we try to reach."""
return float(self.data.cool_temp)
target = float(self.data.cool_temp)
if self.hvac_action != HVACAction.OFF and target < 255:
return target
return None

@property
def target_temperature_low(self):
"""Return the temperature we try to reach."""
return float(self.data.target_temperature)
target = float(self.data.target_temperature)
if self.hvac_action() != HVACAction.OFF and target < 255:
return target
return None

@property
def preset_mode(self) -> str:
Expand Down

0 comments on commit 87fb4ee

Please sign in to comment.