webclient finish, socket io finish, some changes in main

This commit is contained in:
derlole
2025-05-12 10:36:25 +00:00
parent 41b276c734
commit f7d9c3e8c7
11 changed files with 92 additions and 46 deletions

View File

@@ -8,6 +8,7 @@ import os
from modules.persistence import esp_conn_infos
from datetime import datetime, timedelta
from modules.socketio import resend_static_data
from modules.persistence import load_dict, save_dict
esp = Blueprint('eps', __name__, url_prefix='/unsecure/esp')
@@ -43,6 +44,13 @@ def toggle_machine():
VALUES (?, ?, ?)
""", (fullCommand["command"], fullCommand["status"], fullCommand["command_id"]))
new_status = load_dict("machine")
new_status["state"] = "PENDING"
save_dict("machine", new_status)
resend_static_data()
conn.commit()
conn.close()
client = mqtt.Client()