From 7c70c600f430fb563a72580914875a6a57343251 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Mon, 1 Jan 2024 11:38:39 +0100 Subject: [PATCH] bundles/infobeamer-monitor: only alert online devices once --- bundles/infobeamer-monitor/files/monitor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/infobeamer-monitor/files/monitor.py b/bundles/infobeamer-monitor/files/monitor.py index 9ac2333..f61cb43 100644 --- a/bundles/infobeamer-monitor/files/monitor.py +++ b/bundles/infobeamer-monitor/files/monitor.py @@ -169,7 +169,11 @@ while True: state = new_state - if datetime.now(timezone.utc).strftime("%H%M") == "1312" and online_devices: + if ( + datetime.now(timezone.utc).strftime("%H%M") == "1312" + and online_devices + and int(datetime.now(timezone.utc).strftime("%S")) < 30 + ): mqtt_out("Online Devices: {}".format(", ".join(sorted(online_devices)))) sleep(30) except KeyboardInterrupt: