mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2025-05-09 06:34:06 +00:00
add clock option
This commit is contained in:
parent
5af59372e3
commit
234cfff15a
4 changed files with 86 additions and 3 deletions
7
service
7
service
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue