Skip to content

Commit 9928031

Browse files
committed
Error if there is a streamdeck found but no definition file for it
1 parent 08bf36e commit 9928031

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

comms.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,18 @@ func rawOpen(reset bool) (*Device, error) {
8080

8181
retval := &Device{}
8282
id := 0
83+
found := false
8384
// Iterate over the known device types, matching to product ID
8485
for _, devType := range deviceTypes {
8586
if devices[id].ProductID == devType.usbProductID {
8687
retval.deviceType = devType
88+
found = true
89+
break
8790
}
8891
}
92+
if !found {
93+
return nil, errors.New("Found an Elgato device, but not one which there is a definition for")
94+
}
8995
dev, err := devices[id].Open()
9096
if err != nil {
9197
return nil, err

0 commit comments

Comments
 (0)