"fix actor instance error"

This commit is contained in:
Manuel Fritsch 2021-02-20 09:24:03 +01:00
parent f1bcd1e543
commit c78ab29b85
3 changed files with 4 additions and 2 deletions

View file

@ -1 +1 @@
__version__ = "4.0.0.24" __version__ = "4.0.0.25"

View file

@ -117,11 +117,12 @@ class BasicController:
return {"data": list(map(lambda x: x.to_dict(), self.data)), "types":self.get_types()} return {"data": list(map(lambda x: x.to_dict(), self.data)), "types":self.get_types()}
async def add(self, item): async def add(self, item):
print(item)
logging.info("{} Add".format(self.name)) logging.info("{} Add".format(self.name))
item.id = shortuuid.uuid() item.id = shortuuid.uuid()
self.data.append(item) self.data.append(item)
if self.autostart is True: if self.autostart is True:
await self.start(id) await self.start(item.id)
await self.save() await self.save()
return item return item

View file

@ -15,6 +15,7 @@ class Hysteresis(CBPiKettleLogic):
self.heater = self.kettle.heater self.heater = self.kettle.heater
logging.info("Hysteresis {} {} {} {}".format(self.offset_on, self.offset_off, self.id, self.heater)) logging.info("Hysteresis {} {} {} {}".format(self.offset_on, self.offset_off, self.id, self.heater))
self.get_actor_state()
while True: while True: