Compare commits

..

2 Commits

Author SHA1 Message Date
Ninluc 50eb4fe87c Fix bug
Build, push image, and notify Watchtower / build-image (push) Successful in 48s
Build, push image, and notify Watchtower / notify (push) Successful in 11s
2026-08-17 17:28:47 +02:00
Ninluc 44a6be9090 Use added alert message 2026-08-17 17:28:41 +02:00
2 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -234,7 +234,8 @@ def alert():
room_id=webex_room_id,
alert_type=alert_type,
alert_message=alert_message,
alert_id=str(saved_alert.inserted_id)
alert_id=str(saved_alert.inserted_id),
added_alert_info=True
)
webex_status = "reused_room"
room_link = f"https://web.webex.com/spaces/{webex_room_id}"
+5 -3
View File
@@ -300,7 +300,7 @@ def on_new_alert(alert: Alert):
# Sends to cloud server
alert_dict = alert.to_dict()
logs_list = get_systemd_logs(lines=200, service_name="smartwave")
logs_list = asyncio.run(get_systemd_logs(lines=200, service_name="smartwave"))
payload = {
"orchestrator_id": DEVICE_ID,
@@ -349,9 +349,11 @@ def read_local_sensors(microwave_id, initial_dish_height):
print(f"[{microwave_id}] ALERT: Unsafe temperature in technical compartment detected! Temp: {temp}°C, Humidity: {hum}%")
alert = Alert(
AlertType.TEMPERATURE_ALERT,
f"Unsafe temperature in technical compartment detected! Temp: {temp}/{config.MAX_ALLOWED_TEMPERATURE_COOKING_COMPARTMENT}°C, Humidity: {hum}%"
f"Unsafe temperature in technical compartment detected! Temp: {temp}/{config.MAX_ALLOWED_TEMPERATURE_COOKING_COMPARTMENT}°C, Humidity: {hum}%",
redistributed=False
)
lora.send_reliable(payloads.lora_new_alert(alert), max_retries=5)
# lora.send_reliable(payloads.lora_new_alert(alert), max_retries=5)
alert_manager.add_alert(alert)
return None # Abort further processing if unsafe temperature detected
except Exception as e:
log(f"[{microwave_id}] DHT read warning: {e}")