-
Notifications
You must be signed in to change notification settings - Fork 0
/
yamaha_test.go
56 lines (46 loc) · 996 Bytes
/
yamaha_test.go
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
51
52
53
54
55
56
package yamaha
import (
"testing"
"time"
)
// udpate address with you Yamaha receiver's IP address before running 'go test'
const (
address = "192.168.1.50"
)
// sleep in between test commands so you can watch the results on your receiver's display
func TestYamahaAvr(t *testing.T) {
// open the connection to the Yamaha device
device, err := Connect(address)
if err != nil {
t.Error(err)
}
// power it on
if device.PowerOn() != nil {
t.Error(err)
}
time.Sleep(5 * time.Second)
// set input to HDMI1
if device.SetInputHDMI1() != nil {
t.Error(err)
}
time.Sleep(5 * time.Second)
// set volume to -30dB
if device.SetVolume(-300) != nil {
t.Error(err)
}
time.Sleep(5 * time.Second)
// set input to HDMI2
if device.SetInputHDMI2() != nil {
t.Error(err)
}
time.Sleep(5 * time.Second)
// set volume to -40dB
if device.SetVolume(-400) != nil {
t.Error(err)
}
time.Sleep(5 * time.Second)
// power it on
if device.PowerOff() != nil {
t.Error(err)
}
}