mirror of
https://github.com/Kunsi/scheduled-plugin-pretalx-broadcast-tools.git
synced 2024-11-22 01:51:03 +00:00
implement data triggers
Turns out, my code was right the whole time, but the scheduled-player package was not updated.
This commit is contained in:
parent
d3660931fb
commit
48a72a2757
2 changed files with 10 additions and 2 deletions
2
service
2
service
|
@ -20,7 +20,7 @@ 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": time.time()}
|
||||
send_data = {"day": "??", "time": int(time.time())}
|
||||
if event_start is not None:
|
||||
event_now = datetime.now(event_tz)
|
||||
utc_now = datetime.now(pytz.utc)
|
||||
|
|
10
tile.lua
10
tile.lua
|
@ -31,6 +31,11 @@ end
|
|||
|
||||
function M.data_trigger(path, data)
|
||||
log("received data '" .. data .. "' on " .. path)
|
||||
if path == "day" then
|
||||
day = tonumber(data)
|
||||
elseif path == "time" then
|
||||
time = tonumber(data)
|
||||
end
|
||||
end
|
||||
|
||||
function M.updated_config_json(config)
|
||||
|
@ -83,8 +88,11 @@ local function wrap(str, font, size, max_w)
|
|||
end
|
||||
|
||||
local function check_next_talks()
|
||||
time = api.clock.unix()
|
||||
log("time is now " .. time)
|
||||
if time == 0 then
|
||||
log("No time info yet, cannot check for next talks")
|
||||
return
|
||||
end
|
||||
|
||||
room_next_talks = {}
|
||||
all_next_talks = {}
|
||||
|
|
Loading…
Reference in a new issue