From f630707fd08e2d887c649f5eaefe894b2159bbee Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Sun, 2 Jun 2024 11:33:27 +0200 Subject: [PATCH] Continue Flask migration. --- thermostat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/thermostat.py b/thermostat.py index 80981bd..f5c2b70 100644 --- a/thermostat.py +++ b/thermostat.py @@ -132,6 +132,8 @@ def get_metric(metric, current_time, interval): def get_forced_mode(): with app.app_context(): row = db.session.execute(db.select(Set_mode.value, Set_mode.timestamp)).first() + if row is None: + return None #cur.execute("SELECT value, timestamp FROM set_mode WHERE name='mode'") #row = cur.fetchone() data = dict(zip(['value', 'timestamp'], row))