From 0110bbff313d595b061840e7b0335e0d8af1206e Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Wed, 31 Dec 2025 17:04:07 -0500 Subject: [PATCH] cli: be defensive when showing features in solaar show --- lib/solaar/cli/show.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/solaar/cli/show.py b/lib/solaar/cli/show.py index 0a10c178..79f9bfb9 100644 --- a/lib/solaar/cli/show.py +++ b/lib/solaar/cli/show.py @@ -153,7 +153,11 @@ def _print_device(dev, num=None): else: feature_bytes = feature.to_bytes(2, byteorder="little") feature_int = int.from_bytes(feature_bytes, byteorder="little") - flags = dev.request(0x0000, feature_bytes) + try: + flags = dev.request(0x0000, feature_bytes) + except Exception: + print(" %2d: %-22s {%04X} - can't retrieve" % (index, feature, feature_int)) + continue flags = 0 if flags is None else ord(flags[1:2]) flags = common.flag_names(hidpp20_constants.FeatureFlag, flags) version = dev.features.get_feature_version(feature_int)