mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-21 14:38:15 +01:00
test
This commit is contained in:
parent
a8ec65b3e4
commit
5f24e2d149
1 changed files with 5 additions and 2 deletions
|
@ -36,7 +36,9 @@ class MQTTSensor(CBPiSensor):
|
||||||
self.reducedfrequency=int(self.props.get("ReducedLogging", 60))
|
self.reducedfrequency=int(self.props.get("ReducedLogging", 60))
|
||||||
self.kettleid=self.props.get("Kettle", None)
|
self.kettleid=self.props.get("Kettle", None)
|
||||||
self.fermenterid=self.props.get("Fermenter", None)
|
self.fermenterid=self.props.get("Fermenter", None)
|
||||||
self.reducedlogging=True if self.kettleid or self.fermenterid else False
|
logging.info(self.kettleid)
|
||||||
|
logging.info(self.fermenterid)
|
||||||
|
self.reducedlogging = True if self.kettleid or self.fermenterid else False
|
||||||
|
|
||||||
if self.kettleid is not None and self.fermenterid is not None:
|
if self.kettleid is not None and self.fermenterid is not None:
|
||||||
self.reducedlogging=False
|
self.reducedlogging=False
|
||||||
|
@ -66,9 +68,10 @@ class MQTTSensor(CBPiSensor):
|
||||||
if isinstance(val, (int, float, str)):
|
if isinstance(val, (int, float, str)):
|
||||||
self.value = float(val)
|
self.value = float(val)
|
||||||
self.push_update(self.value)
|
self.push_update(self.value)
|
||||||
if self.reducedlogging:
|
if self.reducedlogging == True:
|
||||||
await self.logvalue()
|
await self.logvalue()
|
||||||
else:
|
else:
|
||||||
|
logging.info("MQTTSensor {} regular logging".format(self.sensor.name))
|
||||||
self.log_data(self.value)
|
self.log_data(self.value)
|
||||||
self.lastlog = time.time()
|
self.lastlog = time.time()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue