From 1dd1ace327b1ae9a978bd86985952a5686b16c6f Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 12 Dec 2025 01:54:10 -0800 Subject: [PATCH] cli: Fix crash when showing notification flags. (#3070) --- lib/logitech_receiver/hidpp10.py | 4 +++- lib/solaar/cli/show.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/logitech_receiver/hidpp10.py b/lib/logitech_receiver/hidpp10.py index ae4798b7..e6ee6380 100644 --- a/lib/logitech_receiver/hidpp10.py +++ b/lib/logitech_receiver/hidpp10.py @@ -189,7 +189,9 @@ class Hidpp10: write_register(device, Registers.THREE_LEDS, v1, v2) def get_notification_flags(self, device: Device): - return NotificationFlag(self._get_register(device, Registers.NOTIFICATIONS)) + flags = self._get_register(device, Registers.NOTIFICATIONS) + if flags is not None: + return NotificationFlag(flags) def set_notification_flags(self, device: Device, *flag_bits: NotificationFlag): assert device is not None diff --git a/lib/solaar/cli/show.py b/lib/solaar/cli/show.py index c5d2fbb0..0a10c178 100644 --- a/lib/solaar/cli/show.py +++ b/lib/solaar/cli/show.py @@ -56,7 +56,7 @@ def _print_receiver(receiver): if notification_flags is not None: if notification_flags: notification_names = hidpp10_constants.NotificationFlag.flag_names(notification_flags) - print(f" Notifications: {', '.join(notification_names)} (0x{notification_flags:06X})") + print(f" Notifications: {', '.join(notification_names)} (0x{notification_flags.value:06X})") else: print(" Notifications: (none)")