From 7c1c0a73779601b6303704a00cc1d12df9ca4183 Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Thu, 6 Jun 2024 13:12:33 +0200 Subject: [PATCH] Fix wrong type bug. --- thermostat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thermostat.py b/thermostat.py index 58f5518..f4b1387 100644 --- a/thermostat.py +++ b/thermostat.py @@ -161,7 +161,7 @@ def get_forced_mode(cursor): if row is None: return None data = dict(zip(['value', 'timestamp'], row)) - timestamp = data['timestamp'].replace(tzinfo=timezone.utc).timestamp() + timestamp = datetime.fromisoformat(data['timestamp']).replace(tzinfo=timezone.utc).timestamp() # We ignore old targets but never ignore absence modes if data['value'] in targets and time.time() - timestamp > forced_mode_duration: logging.debug("Ignoring old set mode.")