Fix wrong type bug.
This commit is contained in:
parent
c43bf42666
commit
7c1c0a7377
@ -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.")
|
||||
|
Loading…
Reference in New Issue
Block a user