diff --git a/app/watcher.py b/app/watcher.py index d8a63ff9..71f04d01 100644 --- a/app/watcher.py +++ b/app/watcher.py @@ -51,7 +51,7 @@ class Watcher(Thread): self.listener = None - self.rstatus = _DevStatus(0, 0xFF, None, _UNIFYING_RECEIVER, None, None) + self.rstatus = _DevStatus(0, 0xFF, None, _UNIFYING_RECEIVER, ()) self.rstatus.max_devices = api.C.MAX_ATTACHED_DEVICES self.rstatus.refresh = (actions.full_scan, self) self.rstatus.pair = None # (actions.pair, self) @@ -194,7 +194,7 @@ class Watcher(Thread): updated = True self._device_status_changed(devstatus, C.STATUS.UNAVAILABLE) elif code == 0x11: - status = devices.process_event(devstatus, data) + status = devices.process_event(devstatus, data, self.listener) updated |= self._device_status_changed(devstatus, status) else: _l.warn("unknown event code %02x", code) diff --git a/lib/logitech/unifying_receiver/api.py b/lib/logitech/unifying_receiver/api.py index 0db33221..eccdf34d 100644 --- a/lib/logitech/unifying_receiver/api.py +++ b/lib/logitech/unifying_receiver/api.py @@ -166,8 +166,7 @@ def get_device_info(handle, devnumber, name=None, features=None): d_type = get_device_type(handle, devnumber, features) d_name = get_device_name(handle, devnumber, features) if name is None else name - d_firmware = get_device_firmware(handle, devnumber, features) - devinfo = AttachedDeviceInfo(handle, devnumber, d_type, d_name, d_firmware, features) + devinfo = AttachedDeviceInfo(handle, devnumber, d_type, d_name, features) _l.log(_LOG_LEVEL, "(%d) found device %s", devnumber, devinfo) return devinfo diff --git a/lib/logitech/unifying_receiver/common.py b/lib/logitech/unifying_receiver/common.py index c1f5c27e..26ac84a4 100644 --- a/lib/logitech/unifying_receiver/common.py +++ b/lib/logitech/unifying_receiver/common.py @@ -26,7 +26,6 @@ AttachedDeviceInfo = namedtuple('AttachedDeviceInfo', [ 'number', 'type', 'name', - 'firmware', 'features']) """Firmware information.""" diff --git a/lib/logitech/ur_scanner.py b/lib/logitech/ur_scanner.py index 30753aff..3a5c040c 100644 --- a/lib/logitech/ur_scanner.py +++ b/lib/logitech/ur_scanner.py @@ -34,7 +34,8 @@ def scan_devices(receiver): print ("Device [%d] %s (%s)" % (devinfo.number, devinfo.name, devinfo.type)) # print " Protocol %s" % devinfo.protocol - for fw in devinfo.firmware: + firmware = api.get_device_firmware(receiver, devinfo.number, features=devinfo.features) + for fw in firmware: print (" %s firmware: %s version %s build %d" % (fw.type, fw.name, fw.version, fw.build)) for index in range(0, len(devinfo.features)):