From 197f81aa73d21d695baea597dc6598a202b86a61 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Tue, 18 Oct 2022 15:20:20 +0100 Subject: [PATCH] assume vban.toml for observer example add README to observer example --- examples/observer/README.md | 29 +++++++++++++++++++++++++++++ examples/observer/__main__.py | 11 +++-------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 examples/observer/README.md diff --git a/examples/observer/README.md b/examples/observer/README.md new file mode 100644 index 0000000..42cddbf --- /dev/null +++ b/examples/observer/README.md @@ -0,0 +1,29 @@ +## About + +Registers a class as an observer and defines a callback. + +## Configure + +The script assumes you have connection info saved in a config file named `vban.toml` placed next to `__main__.py`. + +A valid `vban.toml` might look like this: + +```toml +[connection] +ip = "gamepc.local" +port = 6980 +streamname = "Command1" +``` + +It should be placed next to `__main__.py`. + +## Use + +Make sure you have established a working VBAN connection. + +Run the script, then: + +- change GUI parameters to trigger pdirty +- play audio through any bus to trigger ldirty + +Pressing `` will exit. diff --git a/examples/observer/__main__.py b/examples/observer/__main__.py index 2b428d4..8d95011 100644 --- a/examples/observer/__main__.py +++ b/examples/observer/__main__.py @@ -22,7 +22,9 @@ class Observer: def main(): - with vban_cmd.api(kind_id, **opts) as vban: + kind_id = "potato" + + with vban_cmd.api(kind_id) as vban: Observer(vban) while cmd := input("Press to exit\n"): @@ -33,11 +35,4 @@ def main(): if __name__ == "__main__": logging.basicConfig(level=logging.INFO) - kind_id = "potato" - opts = { - "ip": "", - "streamname": "Command1", - "port": 6980, - } - main()