From 5327d6a57b53349e41c886c64e9c753977303d76 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Tue, 8 Nov 2022 19:13:11 +0000 Subject: [PATCH] read mixer kind from config.toml update readme --- README.md | 4 ++-- __main__.py | 4 +++- config.toml | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc3b101..c9623c9 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ pip install . - Configure websocket settings within `OBS->Tools->obs-websocket Settings` -- Open the included `config.toml` and set OBS host, port and password as well as the xair mixers ip. +- Open the included `config.toml` and set OBS host, port and password as well as the xair mixers kind and ip. - - You may also set the kind of mixer in the script. (`XR12, XR16, XR18, MR18, X32`) + - Mixer kind may be any one of (`XR12, XR16, XR18, MR18, X32`) - Set the scene to channel mutes mapping in `mapping.toml`. diff --git a/__main__.py b/__main__.py index 518e264..30c9668 100644 --- a/__main__.py +++ b/__main__.py @@ -61,7 +61,9 @@ class Observer: def main(): - kind_mixer = "XR18" + filepath = Path.cwd() / "config.toml" + with open(filepath, "rb") as f: + kind_mixer = tomllib.load(f)["connection"].get("mixer") with xair_api.connect(kind_mixer) as mixer: o = Observer(mixer) diff --git a/config.toml b/config.toml index ae2bbb4..6b51dee 100644 --- a/config.toml +++ b/config.toml @@ -4,5 +4,6 @@ host = "localhost" port = 4455 password = "strongpassword" -# xair mixer ip +# mixer kind and ip +mixer = "XR18" ip = "mixer.local" \ No newline at end of file