mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2025-01-18 18:36:01 +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):
|
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.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:
|
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,item.id), item.to_dict())
|
||||||
|
|
||||||
def find_by_id(self, id):
|
def find_by_id(self, id):
|
||||||
return next((item for item in self.data if item.id == id), None)
|
return next((item for item in self.data if item.id == id), None)
|
||||||
|
|
|
@ -111,10 +111,10 @@ class FermentationController:
|
||||||
|
|
||||||
def push_update(self):
|
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.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:
|
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,item.id), item.to_dict())
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def shutdown(self, app=None):
|
async def shutdown(self, app=None):
|
||||||
|
|
|
@ -72,7 +72,7 @@ class StepController:
|
||||||
self._loop.create_task(self.start_step(active_step))
|
self._loop.create_task(self.start_step(active_step))
|
||||||
|
|
||||||
async def add(self, item: Step):
|
async def add(self, item: Step):
|
||||||
logging.info("Add step")
|
logging.debug("Add step")
|
||||||
item.id = shortuuid.uuid()
|
item.id = shortuuid.uuid()
|
||||||
item.status = StepState.INITIAL
|
item.status = StepState.INITIAL
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -226,6 +226,6 @@ def setup(cbpi):
|
||||||
:return:
|
:return:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
cbpi.plugin.register("NotificationStep", NotificationStep)
|
cbpi.plugin.register("FermenterNotificationStep", FermenterNotificationStep)
|
||||||
cbpi.plugin.register("TargetTempStep", TargetTempStep)
|
cbpi.plugin.register("FermenterTargetTempStep", FermenterTargetTempStep)
|
||||||
cbpi.plugin.register("FermentationStep", FermentationStep)
|
cbpi.plugin.register("FermentationStep", FermentationStep)
|
||||||
|
|
Loading…
Reference in a new issue