mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-09 17:07:43 +01:00
Merge pull request #30 from avollkopf/development
Merge from Development branch
This commit is contained in:
commit
97a45f144e
2 changed files with 4 additions and 3 deletions
|
@ -1,2 +1,2 @@
|
|||
__version__ = "4.0.1.1"
|
||||
__version__ = "4.0.1.2"
|
||||
|
||||
|
|
|
@ -32,10 +32,11 @@ class CBPiSensor(CBPiBase, metaclass=ABCMeta):
|
|||
def get_unit(self):
|
||||
pass
|
||||
|
||||
def push_update(self, value):
|
||||
def push_update(self, value, mqtt = True):
|
||||
try:
|
||||
self.cbpi.ws.send(dict(topic="sensorstate", id=self.id, value=value))
|
||||
self.cbpi.push_update("cbpi/sensordata/{}".format(self.id), dict(id=self.id, value=value), retain=True)
|
||||
if mqtt:
|
||||
self.cbpi.push_update("cbpi/sensordata/{}".format(self.id), dict(id=self.id, value=value), retain=True)
|
||||
# self.cbpi.push_update("cbpi/sensor/{}/udpate".format(self.id), dict(id=self.id, value=value), retain=True)
|
||||
except:
|
||||
logging.error("Faild to push sensor update")
|
||||
|
|
Loading…
Reference in a new issue