forked from ejonesnospam/pynuvo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
executable file
·51 lines (35 loc) · 1.18 KB
/
test.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import time
from pynuvo import get_nuvo
nuvo = get_nuvo('/dev/ttyS0')
# Valid zones are 1-8 for nuvo concerto amplifier
for x in range(1,8):
zone_status = nuvo.zone_status(x)
zone_status = nuvo.zone_status(1)
# Print zone status
print('Zone Number = {}'.format(zone_status.zone))
print('Power is {}'.format('On' if zone_status.power else 'Off'))
print('Mute is {}'.format('On' if zone_status.mute else 'Off'))
print('Volume = {}'.format(zone_status.volume))
print('Source = {}'.format(zone_status.source))
# Turn on zone #1
nuvo.set_power(1, True)
# Set source 2 for zone #1
nuvo.set_source(1, 2)
# Mute zone #1
nuvo.set_mute(1,True)
# Set volume for zone #1
nuvo.set_volume(1, -45)
# Set source 1 for zone #4
nuvo.set_source(4, 1)
# Turn off zone #1
nuvo.set_power(1, False)
time.sleep(2)
# Restore zone #1 to it's original state
nuvo.restore_zone(zone_status)
zone_status = nuvo.zone_status(1)
# Print zone status
print('Zone Number = {}'.format(zone_status.zone))
print('Power is {}'.format('On' if zone_status.power else 'Off'))
print('Mute is {}'.format('On' if zone_status.mute else 'Off'))
print('Volume = {}'.format(zone_status.volume))
print('Source = {}'.format(zone_status.source))