From 2897b0e6ee55fefc7243c04b18dda2832eb53589 Mon Sep 17 00:00:00 2001 From: Maxime Boissonneault Date: Thu, 20 Oct 2022 17:06:40 -0400 Subject: [PATCH] convert water leak info to 1/0 --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index 8e93006..21829ad 100644 --- a/app.py +++ b/app.py @@ -57,6 +57,11 @@ def metrics(): attrib["currentValue"] = 1 else: attrib["currentValue"] = 0 + if attrib["name"] == "water": + if attrib["currentValue"] == "dry": + attrib["currentValue"] = 1 + else: + attrib["currentValue"] = 0 if attrib["name"] == "power": if attrib["currentValue"] == "on": attrib["currentValue"] = 1