support multiple Wireless PIDs for same device model
This commit is contained in:
parent
49d77a2f90
commit
24f658d8fe
|
@ -45,18 +45,20 @@ def _D(name, codename=None, kind=None, wpid=None, protocol=None, registers=None,
|
||||||
assert registers is None
|
assert registers is None
|
||||||
assert settings is None or all(s._rw.kind == 2 for s in settings)
|
assert settings is None or all(s._rw.kind == 2 for s in settings)
|
||||||
|
|
||||||
DEVICES[codename] = _DeviceDescriptor(
|
device_descriptor = _DeviceDescriptor(name=name, kind=kind,
|
||||||
name=name,
|
wpid=wpid, codename=codename, protocol=protocol,
|
||||||
kind=kind,
|
registers=registers, settings=settings)
|
||||||
wpid=wpid,
|
|
||||||
codename=codename,
|
assert codename not in DEVICES, "duplicate codename in device descriptors: %s" % (DEVICES[codename], )
|
||||||
protocol=protocol,
|
DEVICES[codename] = device_descriptor
|
||||||
registers=registers,
|
|
||||||
settings=settings)
|
|
||||||
|
|
||||||
if wpid:
|
if wpid:
|
||||||
assert wpid not in DEVICES
|
if not isinstance(wpid, tuple):
|
||||||
DEVICES[wpid] = DEVICES[codename]
|
wpid = (wpid, )
|
||||||
|
|
||||||
|
for w in wpid:
|
||||||
|
assert w not in DEVICES, "duplicate wpid in device descriptors: %s" % (DEVICES[w], )
|
||||||
|
DEVICES[w] = device_descriptor
|
||||||
|
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue