Reverted back to item based mqtt updates for testing

This commit is contained in:
avollkopf 2022-01-12 17:56:30 +01:00
parent 03001a2de7
commit 027966af12
5 changed files with 10 additions and 11 deletions

View file

@ -1,2 +1 @@
__version__ = "4.0.1.a8"
__version__ = "4.0.1.a9"

View file

@ -55,9 +55,9 @@ class BasicController:
async def push_udpate(self):
self.cbpi.ws.send(dict(topic=self.update_key, data=list(map(lambda item: item.to_dict(), self.data))))
self.cbpi.push_update("cbpi/{}".format(self.update_key), list(map(lambda item: item.to_dict(), self.data)))
#for item in self.data:
# self.cbpi.push_update("cbpi/{}/{}".format(self.update_key,item.id), item.to_dict())
#self.cbpi.push_update("cbpi/{}".format(self.update_key), list(map(lambda item: item.to_dict(), self.data)))
for item in self.data:
self.cbpi.push_update("cbpi/{}/{}".format(self.update_key,item.id), item.to_dict())
def find_by_id(self, id):
return next((item for item in self.data if item.id == id), None)

View file

@ -111,10 +111,10 @@ class FermentationController:
def push_update(self):
self.cbpi.ws.send(dict(topic=self.update_key, data=list(map(lambda item: item.to_dict(), self.data))))
self.cbpi.push_update("cbpi/{}".format(self.update_key), list(map(lambda item: item.to_dict(), self.data)))
#self.cbpi.push_update("cbpi/{}".format(self.update_key), list(map(lambda item: item.to_dict(), self.data)))
#for item in self.data:
# self.cbpi.push_update("cbpi/{}/{}".format(self.update_key,item.id), item.to_dict())
for item in self.data:
self.cbpi.push_update("cbpi/{}/{}".format(self.update_key,item.id), item.to_dict())
pass
async def shutdown(self, app=None):

View file

@ -72,7 +72,7 @@ class StepController:
self._loop.create_task(self.start_step(active_step))
async def add(self, item: Step):
logging.info("Add step")
logging.debug("Add step")
item.id = shortuuid.uuid()
item.status = StepState.INITIAL
try:

View file

@ -226,6 +226,6 @@ def setup(cbpi):
:return:
'''
cbpi.plugin.register("NotificationStep", NotificationStep)
cbpi.plugin.register("TargetTempStep", TargetTempStep)
cbpi.plugin.register("FermenterNotificationStep", FermenterNotificationStep)
cbpi.plugin.register("FermenterTargetTempStep", FermenterTargetTempStep)
cbpi.plugin.register("FermentationStep", FermentationStep)