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.")