From c78ab29b85f8c281d361553722b6b8d0d4fd696a Mon Sep 17 00:00:00 2001 From: Manuel Fritsch Date: Sat, 20 Feb 2021 09:24:03 +0100 Subject: [PATCH] "fix actor instance error" --- cbpi/__init__.py | 2 +- cbpi/controller/basic_controller2.py | 3 ++- cbpi/extension/hysteresis/__init__.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 4851b45..32a213a 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.0.24" \ No newline at end of file +__version__ = "4.0.0.25" \ No newline at end of file diff --git a/cbpi/controller/basic_controller2.py b/cbpi/controller/basic_controller2.py index ba65c0ed..fc057a9 100644 --- a/cbpi/controller/basic_controller2.py +++ b/cbpi/controller/basic_controller2.py @@ -117,11 +117,12 @@ class BasicController: return {"data": list(map(lambda x: x.to_dict(), self.data)), "types":self.get_types()} async def add(self, item): + print(item) logging.info("{} Add".format(self.name)) item.id = shortuuid.uuid() self.data.append(item) if self.autostart is True: - await self.start(id) + await self.start(item.id) await self.save() return item diff --git a/cbpi/extension/hysteresis/__init__.py b/cbpi/extension/hysteresis/__init__.py index 4b85d84..363fac4 100644 --- a/cbpi/extension/hysteresis/__init__.py +++ b/cbpi/extension/hysteresis/__init__.py @@ -15,6 +15,7 @@ class Hysteresis(CBPiKettleLogic): self.heater = self.kettle.heater logging.info("Hysteresis {} {} {} {}".format(self.offset_on, self.offset_off, self.id, self.heater)) + self.get_actor_state() while True: