diff --git a/lib/logitech_receiver/notifications.py b/lib/logitech_receiver/notifications.py index b17dd753..cc1bdf96 100644 --- a/lib/logitech_receiver/notifications.py +++ b/lib/logitech_receiver/notifications.py @@ -192,7 +192,7 @@ def _process_device_notification(device, status, n): _log.warn('%s: feature notification but features not set up: %02X %s', device, n.sub_id, n) return False try: - feature = device.features[n.sub_id] + feature = device.features.get_feature(n.sub_id) except IndexError: _log.warn('%s: notification from invalid feature index %02X: %s', device, n.sub_id, n) return False diff --git a/lib/logitech_receiver/settings.py b/lib/logitech_receiver/settings.py index fd3be786..41cfdf73 100644 --- a/lib/logitech_receiver/settings.py +++ b/lib/logitech_receiver/settings.py @@ -1243,7 +1243,7 @@ class ActionSettingRW: def write(self, device, data_bytes): def handler(device, n): # Called on notification events from the device - if n.sub_id < 0x40 and device.features[n.sub_id] == _hidpp20.FEATURE.REPROG_CONTROLS_V4: + if n.sub_id < 0x40 and device.features.get_feature(n.sub_id) == _hidpp20.FEATURE.REPROG_CONTROLS_V4: if n.address == 0x00: cids = _unpack('!HHHH', n.data[:8]) if not self.pressed and int(self.key.key) in cids: # trigger key pressed