mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2026-04-06 23:53:31 +00:00
upd examples to read conn from env
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user