瀏覽代碼

Added gateway name name in the log

GatewayStatusUpdate
Lorenzo Pollutri 4 天之前
父節點
當前提交
9b157a6158
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. +1
    -0
      logica_reslevis/gateway.py
  2. +5
    -2
      mqtt_gateway_monitor.py

+ 1
- 0
logica_reslevis/gateway.py 查看文件

@@ -192,6 +192,7 @@ class GatewayJsonRepository:
{
"mac": mac,
"mac_raw": row.get("mac"),
"name": row.get("name"),
"old_status": old_status,
"new_status": new_status,
"first_set": first_set,


+ 5
- 2
mqtt_gateway_monitor.py 查看文件

@@ -214,16 +214,19 @@ class MqttGatewayMonitor:
changes = self._gateway_repo.update_statuses(status_by_mac)
for change in changes:
mac_label = change.get("mac_raw") or change.get("mac")
name_label = change.get("name") or ""
if change.get("first_set"):
log.info(
"Gateway status initialized: mac=%s status=%s",
"Gateway status initialized: mac=%s name=%s status=%s",
mac_label,
name_label,
change.get("new_status"),
)
else:
log.info(
"Gateway status changed: mac=%s %s -> %s",
"Gateway status changed: mac=%s name=%s %s -> %s",
mac_label,
name_label,
change.get("old_status"),
change.get("new_status"),
)

Loading…
取消
儲存