-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_control.py
executable file
·15 lines (12 loc) · 1002 Bytes
/
test_control.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python3
import requests
url = 'http://wxa-50/YamahaRemoteControl/ctrl'
requests.post(url, '<YAMAHA_AV cmd="PUT"><Main_Zone><Power_Control><Power>On</Power></Power_Control></Main_Zone></YAMAHA_AV>')
requests.post(url, '<YAMAHA_AV cmd="PUT"><Main_Zone><Input><Input_Sel>USB</Input_Sel></Input></Main_Zone></YAMAHA_AV>')
requests.post(url, '<YAMAHA_AV cmd="PUT"><Main_Zone><Volume><Lvl><Val>-450</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Volume></Main_Zone></YAMAHA_AV>')
# it won't start playing until any song selected. this also starts playing
requests.post(url, '<YAMAHA_AV cmd="PUT"><USB><List_Control><Direct_Sel>Line_1</Direct_Sel></List_Control></USB></YAMAHA_AV>')
# shuffle
requests.post(url, '<YAMAHA_AV cmd="PUT"><USB><Play_Control><Play_Mode><Shuffle>On</Shuffle></Play_Mode></Play_Control></USB></YAMAHA_AV>')
# next song will be randomly due to shuffle
requests.post(url, '<YAMAHA_AV cmd="PUT"><USB><Play_Control><Playback>Skip Fwd</Playback></Play_Control></USB></YAMAHA_AV>')