Convert boolean to int for Adafruit IO
This commit is contained in:
parent
99810db877
commit
95a0f36bfa
5
main.py
5
main.py
|
@ -75,9 +75,12 @@ class SensorServer(Server):
|
|||
)
|
||||
|
||||
def getReading(self):
|
||||
readings = self.getState()
|
||||
readings['is-water-present'] = 1 if readings['is-water-present'] else 0
|
||||
|
||||
return {
|
||||
'timestamp': util.datetimeISO8601(),
|
||||
'readings': self.getState()
|
||||
'readings': readings
|
||||
}
|
||||
|
||||
def getState(self):
|
||||
|
|
Loading…
Reference in New Issue