bundles/infobeamer-monitor: only alert online devices once

This commit is contained in:
Franzi 2024-01-01 11:38:39 +01:00
parent dfadffd921
commit 7c70c600f4
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -169,7 +169,11 @@ while True:
state = new_state 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)))) mqtt_out("Online Devices: {}".format(", ".join(sorted(online_devices))))
sleep(30) sleep(30)
except KeyboardInterrupt: except KeyboardInterrupt: