Compare commits
2 Commits
9ef4b584a4
...
50eb4fe87c
| Author | SHA1 | Date | |
|---|---|---|---|
| 50eb4fe87c | |||
| 44a6be9090 |
+2
-1
@@ -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}"
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user