Continue Flask migration.

This commit is contained in:
yohan 2024-06-02 10:51:25 +02:00
parent fd2266aaf5
commit 69c791e7ca

View File

@ -118,6 +118,7 @@ def get_metric(metric, current_time, interval):
return None
def get_forced_mode():
with app.app_context():
row = db.session.query(Set_mode.value, Set_mode.timestamp).first()
#cur.execute("SELECT value, timestamp FROM set_mode WHERE name='mode'")
#row = cur.fetchone()
@ -205,6 +206,7 @@ while True:
# break
if new_forced_mode is not None:
with app.app_context():
data = Set_mode({"value": new_forced_mode})
db.session.add(data)
db.session.commit()