|
|
@@ -73,6 +73,26 @@ func TestSetValueConsumesQMKResponse(t *testing.T) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func TestSetLightingColorUsesAllImpact80Channels(t *testing.T) {
|
|
|
+ transport := &fakeTransport{}
|
|
|
+ protocol := Protocol{handle: transport}
|
|
|
+
|
|
|
+ if err := protocol.SetLightingColor(0x55, 0xff); err != nil {
|
|
|
+ t.Fatalf("SetLightingColor() error = %v", err)
|
|
|
+ }
|
|
|
+
|
|
|
+ wantChannels := []byte{0x02, 0x03, 0x04}
|
|
|
+ if len(transport.reports) != len(wantChannels) {
|
|
|
+ t.Fatalf("SendReport() calls = %d, want %d", len(transport.reports), len(wantChannels))
|
|
|
+ }
|
|
|
+ for i, channel := range wantChannels {
|
|
|
+ report := transport.reports[i]
|
|
|
+ if report[0] != 0x07 || report[1] != channel || report[2] != 0x04 || report[3] != 0x55 || report[4] != 0xff {
|
|
|
+ t.Errorf("color report %d = %v, want channel 0x%02x hue 0x55 saturation 0xff", i, report, channel)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func TestSetColorUsesQMKColorValue(t *testing.T) {
|
|
|
transport := &fakeTransport{}
|
|
|
protocol := Protocol{handle: transport}
|