From aba29ffa52b953f645b506fb41cdaccb00ed7d51 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 30 Sep 2023 13:52:06 +0200 Subject: [PATCH] support all kinds of node names --- README.md | 4 ---- service | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a6ac9a2..c137275 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,6 @@ pretalx installation! [Import this package to info-beamer.com](https://info-beamer.com/use?url=https%3A%2F%2Fgithub.com%2FKunsi%2Fscheduled-plugin-pretalx-broadcast-tools.git) -It's important that you import this plugin under one of the paths -`pretalx` or `pretalx-broadcast-tools` into your setup. Otherwise -no information will be shown! - ## Features * show the next talk in the configured room diff --git a/service b/service index 61f7e4b..c989111 100755 --- a/service +++ b/service @@ -1,4 +1,5 @@ #!/usr/bin/python +import os import sys import time import traceback @@ -11,6 +12,8 @@ from hosted import config, node config.restart_on_update() +SEND_PREFIX = os.environ["NODE"].replace("root/", "root/plugin/") + def log(msg): sys.stderr.write("[pretalx] {}\n".format(msg)) @@ -39,8 +42,7 @@ def idle(seconds, event_start, event_tz): send_data["day"] = day_info.days for k, v in send_data.items(): - node.send_raw("root/plugin/pretalx/{}:{}".format(k, v)) - node.send_raw("root/plugin/pretalx-broadcast-tools/{}:{}".format(k, v)) + node.send_raw("{}/{}:{}".format(SEND_PREFIX, k, v)) time.sleep(1)