From e55f32bfb6562549de7d66187b12045991c9bd78 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 8 Dec 2024 15:49:19 +0100 Subject: [PATCH] use device serial if description is not set --- bundles/infobeamer-monitor/files/monitor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bundles/infobeamer-monitor/files/monitor.py b/bundles/infobeamer-monitor/files/monitor.py index e5755c2..01ffe29 100644 --- a/bundles/infobeamer-monitor/files/monitor.py +++ b/bundles/infobeamer-monitor/files/monitor.py @@ -40,7 +40,10 @@ def mqtt_out(message, level="INFO", device=None): key = "infobeamer" if device: key += f"/{device['id']}" - message = f"[{device['description']}] {message}" + if device["description"]: + message = f"[{device['description']}] {message}" + else: + message = f"[{device['serial']}] {message}" client.publish( CONFIG["mqtt"]["topic"],