mirror of
https://github.com/pwr-Solaar/Solaar.git
synced 2025-12-13 20:35:45 +01:00
cli: Fix crash when showing notification flags. (#3070)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user