diff --git a/node.json b/node.json index 1855e7e..9383d1c 100644 --- a/node.json +++ b/node.json @@ -24,6 +24,12 @@ "name": "font_day", "type": "font", "default": "silkscreen.ttf" + }, { + "title": "Clock", + "ui_width": 6, + "name": "font_clock", + "type": "font", + "default": "silkscreen.ttf" }, { "title": "all other text", "ui_width": 6, @@ -45,6 +51,13 @@ "name": "show_track", "type": "boolean", "default": true + }, { + "title": "Clock format", + "ui_width": 4, + "name": "clock_format", + "type": "string", + "default": "%H:%M", + "hint": "strftime() format specifier" }, { "title": "Schedule", "type": "section" diff --git a/service b/service index d36e5c6..d73ff4b 100755 --- a/service +++ b/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(): diff --git a/tile.js b/tile.js index 9484471..e8e43be 100644 --- a/tile.js +++ b/tile.js @@ -11,6 +11,7 @@ var config = { +
@@ -60,7 +61,7 @@ var config = {
+