- fixed heater

This commit is contained in:
jens
2021-10-09 11:40:29 +01:00
parent fb71f9554c
commit ac6139cae7
+2 -1
View File
@@ -17,7 +17,7 @@ class HeaterTask(ATask):
self.pulse_counter = 0
def actor(self, y):
self.power_soll = max(0, 250 + self.device.get_power_max() * y)
self.power_soll = max(0, self.device.get_power_max() * y)
def on_changed_active(self, is_activated):
asyncio.create_task(self.send({'Activate': int(is_activated)}))
@@ -52,6 +52,7 @@ class HeaterTask(ATask):
if self.pulse_counter >= pulse_period_count:
self.pulse_counter = 0
print ("power_soll = {}".format(self.power_soll))
if self.power_soll < self.device.get_power_min():
if self.power_soll == 0 or self.pulse_counter >= on_count:
self.device.set_power(0)