-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
32 lines (29 loc) · 759 Bytes
/
test.py
File metadata and controls
32 lines (29 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from queue import Empty
import logging
logging.basicConfig()
import soco
from pprint import pprint
from soco.events import event_listener
# pick a device at random and use it to get
# the group coordinator
device = soco.SoCo("192.168.11.32")
print (device.player_name)
#sub = device.renderingControl.subscribe()
sub2 = device.avTransport.subscribe()
while True:
# try:
# event = sub.events.get(timeout=0.5)
# pprint (event.variables)
# except Empty:
# pass
try:
event = sub2.events.get(timeout=0.5)
pprint (event.variables)
except Empty:
pass
except KeyboardInterrupt:
print("STOP")
#sub.unsubscribe()
sub2.unsubscribe()
event_listener.stop()
break