mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2025-01-03 11:21:44 +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)
|
await self.client.subscribe(topic)
|
||||||
async for message in messages:
|
async for message in messages:
|
||||||
await method(message.payload.decode())
|
await method(message.payload.decode())
|
||||||
except asyncio.CancelledError as e:
|
except asyncio.CancelledError:
|
||||||
# Cancel
|
# Cancel
|
||||||
self.logger.warning(
|
self.logger.warning("Sub Cancelled")
|
||||||
"Sub CancelledError Exception: {}".format(e))
|
|
||||||
return
|
|
||||||
except MqttError as e:
|
except MqttError as e:
|
||||||
self.logger.error("Sub MQTT Exception: {}".format(e))
|
self.logger.error("Sub MQTT Exception: {}".format(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
@ -113,7 +113,7 @@ class CraftBeerPi:
|
||||||
self.upload : UploadController = UploadController(self)
|
self.upload : UploadController = UploadController(self)
|
||||||
self.notification : NotificationController = NotificationController(self)
|
self.notification : NotificationController = NotificationController(self)
|
||||||
self.satellite = None
|
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.satellite: SatelliteController = SatelliteController(self)
|
||||||
|
|
||||||
self.dashboard = DashboardController(self)
|
self.dashboard = DashboardController(self)
|
||||||
|
|
|
@ -65,5 +65,5 @@ def setup(cbpi):
|
||||||
:param cbpi: the cbpi core
|
:param cbpi: the cbpi core
|
||||||
:return:
|
: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)
|
cbpi.plugin.register("MQTTActor", MQTTActor)
|
||||||
|
|
|
@ -58,5 +58,5 @@ def setup(cbpi):
|
||||||
:param cbpi: the cbpi core
|
:param cbpi: the cbpi core
|
||||||
:return:
|
: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)
|
cbpi.plugin.register("MQTTSensor", MQTTSensor)
|
||||||
|
|
Loading…
Reference in a new issue