don't always show Notifications in details

This commit is contained in:
Daniel Pavel 2013-07-05 14:34:37 +02:00
parent 87e2f1cad7
commit 065b8628d2
2 changed files with 2 additions and 6 deletions

View File

@ -137,9 +137,7 @@ def _print_device(dev, verbose=False):
if dev.online: if dev.online:
notification_flags = hidpp10.get_notification_flags(dev) notification_flags = hidpp10.get_notification_flags(dev)
if notification_flags is None: if notification_flags is not None:
print (" Notifications: N/A.")
else:
if notification_flags: if notification_flags:
notification_names = hidpp10.NOTIFICATION_FLAG.flag_names(notification_flags) notification_names = hidpp10.NOTIFICATION_FLAG.flag_names(notification_flags)
print (" Notifications: 0x%06X = %s." % (notification_flags, ', '.join(notification_names))) print (" Notifications: 0x%06X = %s." % (notification_flags, ', '.join(notification_names)))

View File

@ -515,9 +515,7 @@ def _update_details(button):
yield (' Firmware', '...') yield (' Firmware', '...')
flag_bits = device.status.get(_K.NOTIFICATION_FLAGS) flag_bits = device.status.get(_K.NOTIFICATION_FLAGS)
if flag_bits is None and device.kind is not None: if flag_bits is not None:
yield ('Notifications', 'N/A')
else:
flag_names = ('(none)',) if flag_bits == 0 else _hidpp10.NOTIFICATION_FLAG.flag_names(flag_bits) flag_names = ('(none)',) if flag_bits == 0 else _hidpp10.NOTIFICATION_FLAG.flag_names(flag_bits)
yield ('Notifications', ('\n%15s' % ' ').join(flag_names)) yield ('Notifications', ('\n%15s' % ' ').join(flag_names))