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

@@ -42,14 +42,14 @@ def on_message(client, userdata, msg):
if msg.topic == MQTT_TOPIC_SUB:
print(f"[MQTT] Nachricht empfangen: {msg.topic} -> {msg.payload.decode()}")
esp_conn_infos["last_seen"] = datetime.now()
refactor_and_use_esp_data(msg.payload.decode())
refactor_and_use_esp_data(msg.payload.decode()) # form modules other
elif msg.topic == MQTT_TOPIC_RETURN:
print(f"[MQTT] Nachricht empfangen: {msg.topic} -> {msg.payload.decode()}")
try:
payload = json.loads(msg.payload.decode())
command_id = payload.get("command_id")
if command_id:
update_command_status(command_id, "served") # form modules
update_command_status(command_id, "served") # form modules db
else:
print("[MQTT] Keine command_id im Payload gefunden.")
except json.JSONDecodeError as e: