Skip to content

Commit

Permalink
Merge pull request #86 from rhammen/main
Browse files Browse the repository at this point in the history
2 small fixes for the thermostat status display
  • Loading branch information
BenPru committed Feb 15, 2023
2 parents b461f8c + 9805dd8 commit 2947c3c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions custom_components/luxtronik/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ def hvac_action(self):
new_hvac_action = CURRENT_HVAC_HEAT
elif status == LUX_STATUS_COOLING:
new_hvac_action = CURRENT_HVAC_COOL
elif status in [LUX_STATUS_HEATING, LUX_STATUS_NO_REQUEST, LUX_STATUS_EVU] and self.__get_hvac_mode(CURRENT_HVAC_IDLE) != HVAC_MODE_OFF:
new_hvac_action = CURRENT_HVAC_IDLE
else:
elif self.__get_hvac_mode(CURRENT_HVAC_IDLE) == HVAC_MODE_OFF:
new_hvac_action = CURRENT_HVAC_OFF
else:
new_hvac_action = CURRENT_HVAC_IDLE
if new_hvac_action != self._attr_hvac_action:
self._attr_hvac_action = new_hvac_action
self._async_control_heating()
Expand Down Expand Up @@ -315,8 +315,6 @@ def __get_hvac_mode(self, hvac_action):
self._last_lux_mode = luxmode
if luxmode in [LuxMode.holidays, LuxMode.party, LuxMode.second_heatsource]:
return self._attr_hvac_mode
elif luxmode == LuxMode.off and self._control_mode_home_assistant and hvac_action == CURRENT_HVAC_IDLE:
return self._attr_hvac_mode
elif luxmode == LuxMode.off:
return HVAC_MODE_OFF
return HVAC_MODE_AUTO
Expand Down Expand Up @@ -423,7 +421,7 @@ def icon(self): # -> str | None:
return result_icon

def _is__heating_on_special(self) -> bool:
return self._luxtronik.get_value(self._status_sensor) in [LUX_STATUS_DEFROST, LUX_STATUS_DOMESTIC_WATER] and self._attr_hvac_mode != HVAC_MODE_OFF and self._luxtronik.get_value(LUX_BINARY_SENSOR_CIRCULATION_PUMP_HEATING)
return self._luxtronik.get_value(self._status_sensor) in [LUX_STATUS_DEFROST] and self._attr_hvac_mode != HVAC_MODE_OFF and self._luxtronik.get_value(LUX_BINARY_SENSOR_CIRCULATION_PUMP_HEATING)

class LuxtronikCoolingThermostat(LuxtronikThermostat):
_attr_unique_id = 'cooling'
Expand Down

0 comments on commit 2947c3c

Please sign in to comment.