diff --git a/node.json b/node.json index 5f52981..d6a45b7 100644 --- a/node.json +++ b/node.json @@ -98,11 +98,11 @@ "itemname": "Room", "hint": "Define all rooms in your schedule and assign them to devices", "items": [{ - "title": "Room Name", + "title": "Room Name or UUID", "ui_width": 6, "name": "name", "type": "string", - "hint": "Name of this room in your events native language", + "hint": "Name of this room in your events native language or room UUID", "default": "" }, { "title": "Serial", diff --git a/service b/service index d88c271..3966360 100755 --- a/service +++ b/service @@ -91,10 +91,13 @@ def main(): else: event_info = r.json() + room_uuid_mapping = {} if event_info is not None: event_start = datetime.strptime(event_info["start"], "%Y-%m-%d") event_end = datetime.strptime(event_info["end"], "%Y-%m-%d") event_tz = pytz.timezone(event_info["timezone"]) + for uuid, room_name in event_info.get("rooms", {}).items(): + room_uuid_mapping[room_name] = uuid try: r = get( @@ -116,6 +119,7 @@ def main(): .astimezone(event_tz) .strftime("%H:%M") ) + talk["room_uuid"] = room_uuid_mapping.get("room") if talk["track"]: if talk["track"]["name"] not in tracks: tracks[talk["track"]["name"]] = talk["track"]["color"] @@ -142,6 +146,10 @@ def main(): "talks": [], } + room_uuid_mapping = {} + for room in raw_schedule["conference"]["rooms"]: + room_uuid_mapping[room["name"]] = room["guid"] + event_start = datetime.strptime( raw_schedule["conference"]["start"][:10], "%Y-%m-%d" ) @@ -183,6 +191,8 @@ def main(): break talk["track"] = track + talk["room_uuid"] = room_uuid_mapping.get(talk["room"]) + persons = [] for p in talk["persons"]: name = p.get("public_name", p.get("name")) diff --git a/tile.lua b/tile.lua index 9ff812e..97a6a26 100644 --- a/tile.lua +++ b/tile.lua @@ -139,7 +139,7 @@ local function check_next_talks() -- to announce these. if talk.end_ts > time and talk.start_ts > min_start then -- is this in *this* room, or somewhere else? - if current_room and talk.room == current_room then + if current_room and (talk.room == current_room or talk.room_uuid == current_room) then room_next_talks[#room_next_talks+1] = talk end all_next_talks[#all_next_talks+1] = talk