add clock option

This commit is contained in:
Franzi 2023-12-18 11:30:50 +01:00
parent 5af59372e3
commit 234cfff15a
4 changed files with 86 additions and 3 deletions

View file

@ -24,7 +24,11 @@ def idle(seconds, event_start, event_tz):
end = time.time() + seconds
log("sleeping for {} seconds".format(seconds))
while time.time() < end:
send_data = {"day": "??", "time": int(time.time())}
send_data = {
"clock": "??",
"day": "??",
"time": int(time.time()),
}
if event_start is not None:
event_now = datetime.now(event_tz)
utc_now = datetime.now(pytz.utc)
@ -38,6 +42,7 @@ def idle(seconds, event_start, event_tz):
log("Day0: {}".format(day_zero.isoformat()))
log("NOW: {}".format(event_now.isoformat()))
send_data["clock"] = event_now.strftime(config["clock_format"])
send_data["day"] = day_info.days
for k, v in send_data.items():