From 26da7c66bc8a856d1a12455aa44d7e4d3408d813 Mon Sep 17 00:00:00 2001 From: Manuel83 Date: Sun, 18 Jun 2017 20:08:17 +0200 Subject: [PATCH] Add actor_power to Controller --- modules/base_plugins/hysteresis/__init__.py | 3 +++ modules/core/controller.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/modules/base_plugins/hysteresis/__init__.py b/modules/base_plugins/hysteresis/__init__.py index 55e06dc..06941ab 100644 --- a/modules/base_plugins/hysteresis/__init__.py +++ b/modules/base_plugins/hysteresis/__init__.py @@ -29,6 +29,9 @@ class Hysteresis(KettleController): :return: ''' while self.is_running(): + + self.actor_power(50) + if self.get_temp() < self.get_target_temp() - int(self.on): self.heater_on(100) elif self.get_temp() >= self.get_target_temp() - int(self.off): diff --git a/modules/core/controller.py b/modules/core/controller.py index c744520..a0d5494 100644 --- a/modules/core/controller.py +++ b/modules/core/controller.py @@ -17,6 +17,12 @@ class ActorController(object): self.api.switch_actor_off(int(id)) + @cbpi.try_catch(None) + def actor_power(self, power, id=None): + if id is None: + id = self.heater + self.api.actor_power(int(id), power) + class SensorController(object):