diff --git a/lib/logitech_receiver/device.py b/lib/logitech_receiver/device.py index d241249e..60611131 100644 --- a/lib/logitech_receiver/device.py +++ b/lib/logitech_receiver/device.py @@ -204,7 +204,7 @@ class Device: self.registers = self.descriptor.registers if self.descriptor.registers else [] if self._protocol is not None: - self.features = None if self._protocol < 2.0 else hidpp20.FeaturesArray(self) + self.features = {} if self._protocol < 2.0 else hidpp20.FeaturesArray(self) else: self.features = hidpp20.FeaturesArray(self) # may be a 2.0 device; if not, it will fix itself later diff --git a/lib/logitech_receiver/hidpp20.py b/lib/logitech_receiver/hidpp20.py index 92d09dec..c966981d 100644 --- a/lib/logitech_receiver/hidpp20.py +++ b/lib/logitech_receiver/hidpp20.py @@ -1690,10 +1690,10 @@ class Hidpp20: def get_keys(self, device: Device): # TODO: add here additional variants for other REPROG_CONTROLS count = None - if SupportedFeature.REPROG_CONTROLS_V2 in device.features: + if device.features and SupportedFeature.REPROG_CONTROLS_V2 in device.features: count = device.feature_request(SupportedFeature.REPROG_CONTROLS_V2) return KeysArrayV2(device, ord(count[:1])) - elif SupportedFeature.REPROG_CONTROLS_V4 in device.features: + elif device.features and SupportedFeature.REPROG_CONTROLS_V4 in device.features: count = device.feature_request(SupportedFeature.REPROG_CONTROLS_V4) return KeysArrayV4(device, ord(count[:1])) return None