ui: handle devices and receivers with no firmware information

This commit is contained in:
Peter F. Patel-Schneider 2020-03-16 16:00:55 -04:00 committed by Filipe Laíns
parent d5a3a4fe7e
commit 072f932206
2 changed files with 6 additions and 4 deletions

View File

@ -73,8 +73,9 @@ def _print_device(dev):
if dev.polling_rate:
print (' Polling rate :', dev.polling_rate, 'ms (%dHz)' % (1000 // dev.polling_rate))
print (' Serial number:', dev.serial)
for fw in dev.firmware:
print (' %11s:' % fw.kind, (fw.name + ' ' + fw.version).strip())
if dev.firmware:
for fw in dev.firmware:
print (' %11s:' % fw.kind, (fw.name + ' ' + fw.version).strip())
if dev.power_switch_location:
print (' The power switch is located on the %s.' % dev.power_switch_location)

View File

@ -525,8 +525,9 @@ def _update_details(button):
yield (_("Serial"), '...')
if read_all:
for fw in list(device.firmware):
yield (' ' + _(str(fw.kind)), (fw.name + ' ' + fw.version).strip())
if device.firmware:
for fw in list(device.firmware):
yield (' ' + _(str(fw.kind)), (fw.name + ' ' + fw.version).strip())
elif device.kind is None or device.online:
yield (' %s' % _("Firmware"), '...')