upd examples to read conn from env

This commit is contained in:
2026-01-18 15:17:00 +00:00
parent 0512fac710
commit 7f3b0ac7c9
3 changed files with 23 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import os
import threading
from logging import config
@@ -92,8 +93,13 @@ class Observer:
def main():
KIND_ID = 'potato'
conn = {
'ip': os.environ.get('VBANCMD_IP', 'localhost'),
'port': int(os.environ.get('VBANCMD_PORT', 6980)),
'streamname': os.environ.get('VBANCMD_STREAMNAME', 'Command1'),
}
with vban_cmd.api(KIND_ID) as vban:
with vban_cmd.api(KIND_ID, **conn) as vban:
stop_event = threading.Event()
with Observer(vban, stop_event):