bundles/infobeamer-monitor: announce online devices at 09:00 CE(S)T

This commit is contained in:
Franzi 2024-11-16 14:14:05 +01:00
parent 6a203085b9
commit b3070a8b8b
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -1,9 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import logging import logging
from datetime import datetime, timezone from datetime import datetime
from json import dumps from json import dumps
from time import sleep from time import sleep
from zoneinfo import ZoneInfo
import paho.mqtt.client as mqtt import paho.mqtt.client as mqtt
from requests import RequestException, get from requests import RequestException, get
@ -210,7 +211,7 @@ while True:
level="WARN", level="WARN",
) )
if datetime.now(timezone.utc).strftime("%H%M") == "1312": if datetime.now(ZoneInfo("Europe/Berlin")).strftime("%H%M") == "0900":
if available_credits is not None: if available_credits is not None:
mqtt_out(f"Available Credits: {available_credits}") mqtt_out(f"Available Credits: {available_credits}")