Enhance smart heating configurations to include sleeping conditions and update fan mode handling in SmartHeatpump

This commit is contained in:
2026-05-31 21:50:06 +02:00
parent fc6673e98b
commit 89b08b1fc5
2 changed files with 46 additions and 9 deletions

View File

@@ -22,7 +22,10 @@ class SmartHeatpump(SmartObject):
else:
self.horizontal_vane = None
self.fan_mode = SmartValue.Evaluator(self,self.args['fan_mode'], expression_name = 'fan_mode', on_change_cb = self.on_change_fan_mode, constants = self.constants)
if 'fan_mode' in self.args:
self.fan_mode = SmartValue.Evaluator(self,self.args['fan_mode'], expression_name = 'fan_mode', on_change_cb = self.on_change_fan_mode, constants = self.constants)
else:
self.fan_mode = None
self.smart_conditions_evaluator = SmartCondition.Evaluator(self,self.args['smart_conditions'],condition_name = "smart_conditions",on_change_cb = self.on_smart_conditions_change,constants = self.constants, templates_library = self.templates_library)
if 'input_buttons' in self.args:
@@ -44,7 +47,7 @@ class SmartHeatpump(SmartObject):
self.set_state(self.args['quick_resume']['sensor'],state = 'on')
temperature = self.target_temperature.evaluate(False)
hvac_mode = self.hvac_mode.evaluate(False)
fan_mode = self.fan_mode.evaluate(False)
fan_mode = self.fan_mode.evaluate(False) if self.fan_mode else None
self.log_info(f"Starting Heatpump in {hvac_mode} mode, with target_temperature of {temperature}° and {fan_mode} fan speed")
#self.turn_on(self.entity_id)
@@ -53,8 +56,9 @@ class SmartHeatpump(SmartObject):
self.call_service("climate/set_hvac_mode", entity_id = self.entity_id,hvac_mode = hvac_mode)
time.sleep(1)
self.call_service("climate/set_temperature", entity_id = self.entity_id,temperature = temperature,hvac_mode = hvac_mode)
time.sleep(1)
self.call_service("climate/set_fan_mode", entity_id = self.entity_id,fan_mode = fan_mode)
if self.fan_mode:
time.sleep(1)
self.call_service("climate/set_fan_mode", entity_id = self.entity_id,fan_mode = fan_mode)
if self.horizontal_vane:
time.sleep(1)
horizontal_vane = self.horizontal_vane.evaluate(False)