From 95a0f36bfa92bf20fef350710e99b5a212b90a81 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Sat, 15 Jul 2023 11:13:15 -0400 Subject: [PATCH] Convert boolean to int for Adafruit IO --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 972a021..4591f22 100644 --- a/main.py +++ b/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):