From 2a018fb731fb5efd04b3544c922ed1232aabfbc6 Mon Sep 17 00:00:00 2001 From: Manuel Fritsch Date: Sun, 14 Mar 2021 17:40:44 +0100 Subject: [PATCH] "fix mqtt push update issue" --- cbpi/__init__.py | 2 +- cbpi/craftbeerpi.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 5cd23c6..e16d4b8 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1 +1 @@ -__version__ = "4.0.0.32" \ No newline at end of file +__version__ = "4.0.0.33" \ No newline at end of file diff --git a/cbpi/craftbeerpi.py b/cbpi/craftbeerpi.py index feeeb88..ced9644 100644 --- a/cbpi/craftbeerpi.py +++ b/cbpi/craftbeerpi.py @@ -224,7 +224,9 @@ class CraftBeerPi: self.notification.notify(title, message, type, action) def push_update(self, topic, data, retain=False) -> None: - asyncio.create_task(self.satellite.publish(topic=topic, message=json.dumps(data), retain=retain)) + + if self.satellite is not None: + asyncio.create_task(self.satellite.publish(topic=topic, message=json.dumps(data), retain=retain)) async def call_initializer(self, app): self.initializer = sorted(self.initializer, key=lambda k: k['order'])