From c07c30baefdbad788e0e522b8db82e43351725ea Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Fri, 23 Aug 2024 09:51:37 -0400 Subject: [PATCH] device: handle error return on root feature --- lib/logitech_receiver/hidpp20.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/logitech_receiver/hidpp20.py b/lib/logitech_receiver/hidpp20.py index b54dc1e9..859e7a51 100644 --- a/lib/logitech_receiver/hidpp20.py +++ b/lib/logitech_receiver/hidpp20.py @@ -140,8 +140,11 @@ class FeaturesArray(dict): return self.version.get(feature, 0) def __contains__(self, feature: NamedInt) -> bool: - index = self.__getitem__(feature) - return index is not None and index is not False + try: + index = self.__getitem__(feature) + return index is not None and index is not False + except exceptions.FeatureCallError: + return False def __getitem__(self, feature: NamedInt) -> Optional[int]: index = super().get(feature)