We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16db15a commit 2000489Copy full SHA for 2000489
labgrid/resource/udev.py
@@ -671,10 +671,14 @@ class HIDRelay(USBResource):
671
index = attr.ib(default=1, validator=attr.validators.instance_of(int))
672
invert = attr.ib(default=False, validator=attr.validators.instance_of(bool))
673
674
- def __attrs_post_init__(self):
675
- self.match['ID_VENDOR_ID'] = '16c0'
676
- self.match['ID_MODEL_ID'] = '05df'
677
- super().__attrs_post_init__()
+ def filter_match(self, device):
+ match = (device.properties.get('ID_VENDOR_ID'), device.properties.get('ID_MODEL_ID'))
+
+ if match not in [("16c0", "05df"), # dcttech USBRelay2
678
+ ]:
679
+ return False
680
681
+ return super().filter_match(device)
682
683
@target_factory.reg_resource
684
@attr.s(eq=False)
0 commit comments