diff --git a/service b/service index c8a9339..61f7e4b 100755 --- a/service +++ b/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) diff --git a/tile.lua b/tile.lua index 3ba928b..cae0024 100644 --- a/tile.lua +++ b/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 = {}