mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-10 01:17:42 +01:00
Reverted back to item based mqtt updates for testing
This commit is contained in:
parent
03001a2de7
commit
027966af12
5 changed files with 10 additions and 11 deletions
|
@ -1,2 +1 @@
|
|||
__version__ = "4.0.1.a8"
|
||||
|
||||
__version__ = "4.0.1.a9"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue