diff --git a/brewpi.py b/brewpi.py index f3cbefc..9323599 100644 --- a/brewpi.py +++ b/brewpi.py @@ -92,7 +92,7 @@ class HeaterTask(ATask): self.heater.process() power.set(round(self.heater.getPower())) if power.is_changed(): - await self.send({'Power': power.get(), 'Activate': int(self.heater.getPower() != 0)}) + await self.send({'Power': power.get(), 'Activate': int(self.heater.is_activated() != 0)}) await asyncio.sleep(self.interval) diff --git a/components/actor/heater.py b/components/actor/heater.py index c0be6a4..01662b4 100644 --- a/components/actor/heater.py +++ b/components/actor/heater.py @@ -17,6 +17,9 @@ class Heater(AHeater): def activate(self, enable): self.is_active = enable + def is_activated(self): + return self.is_active + def process(self): self.power_eff = self.power_set if self.is_active else 0 diff --git a/components/aheater.py b/components/aheater.py index 9b9904e..4c637d9 100644 --- a/components/aheater.py +++ b/components/aheater.py @@ -18,6 +18,10 @@ class AHeater(AttributeChange): def activate(self, enable): return None + @abc.abstractmethod + def is_activated(self): + return None + @abc.abstractmethod def process(self): pass