From 9b157a6158b11d4220f7a1ae7df95302f73c7cd0 Mon Sep 17 00:00:00 2001 From: pollutri Date: Fri, 30 Jan 2026 16:26:49 +0100 Subject: [PATCH] Added gateway name name in the log --- logica_reslevis/gateway.py | 1 + mqtt_gateway_monitor.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/logica_reslevis/gateway.py b/logica_reslevis/gateway.py index f9d9122..529f762 100644 --- a/logica_reslevis/gateway.py +++ b/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, diff --git a/mqtt_gateway_monitor.py b/mqtt_gateway_monitor.py index 410a42e..1abecee 100644 --- a/mqtt_gateway_monitor.py +++ b/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"), )