mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-09 17:07:43 +01:00
mqtt sensor fix
- mqtt sensor is now also working after changing the configuration - config.yaml accepts now also 'true' besides 'True' to activate mqtt
This commit is contained in:
parent
71897c8276
commit
3724f76faa
5 changed files with 6 additions and 8 deletions
|
@ -1 +1 @@
|
|||
__version__ = "4.0.0.50"
|
||||
__version__ = "4.0.0.51"
|
||||
|
|
|
@ -81,11 +81,9 @@ class SatelliteController:
|
|||
await self.client.subscribe(topic)
|
||||
async for message in messages:
|
||||
await method(message.payload.decode())
|
||||
except asyncio.CancelledError as e:
|
||||
except asyncio.CancelledError:
|
||||
# Cancel
|
||||
self.logger.warning(
|
||||
"Sub CancelledError Exception: {}".format(e))
|
||||
return
|
||||
self.logger.warning("Sub Cancelled")
|
||||
except MqttError as e:
|
||||
self.logger.error("Sub MQTT Exception: {}".format(e))
|
||||
except Exception as e:
|
||||
|
|
|
@ -113,7 +113,7 @@ class CraftBeerPi:
|
|||
self.upload : UploadController = UploadController(self)
|
||||
self.notification : NotificationController = NotificationController(self)
|
||||
self.satellite = None
|
||||
if self.static_config.get("mqtt", False) is True:
|
||||
if str(self.static_config.get("mqtt", False)).lower() == "true":
|
||||
self.satellite: SatelliteController = SatelliteController(self)
|
||||
|
||||
self.dashboard = DashboardController(self)
|
||||
|
|
|
@ -65,5 +65,5 @@ def setup(cbpi):
|
|||
:param cbpi: the cbpi core
|
||||
:return:
|
||||
'''
|
||||
if cbpi.static_config.get("mqtt", False) is True:
|
||||
if str(cbpi.static_config.get("mqtt", False)).lower() == "true":
|
||||
cbpi.plugin.register("MQTTActor", MQTTActor)
|
||||
|
|
|
@ -58,5 +58,5 @@ def setup(cbpi):
|
|||
:param cbpi: the cbpi core
|
||||
:return:
|
||||
'''
|
||||
if cbpi.static_config.get("mqtt", False) is True:
|
||||
if str(cbpi.static_config.get("mqtt", False)).lower() == "true":
|
||||
cbpi.plugin.register("MQTTSensor", MQTTSensor)
|
||||
|
|
Loading…
Reference in a new issue