cli: show battery information under unified battery feature

This commit is contained in:
Peter F. Patel-Schneider 2021-08-02 16:55:03 -04:00
parent 18d79f8dd4
commit 70a0fcd906
1 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,8 @@ from logitech_receiver import settings_templates as _settings_templates
from logitech_receiver.common import NamedInt as _NamedInt from logitech_receiver.common import NamedInt as _NamedInt
from logitech_receiver.common import strhex as _strhex from logitech_receiver.common import strhex as _strhex
_F = _hidpp20.FEATURE
def _print_receiver(receiver): def _print_receiver(receiver):
paired_count = receiver.count() paired_count = receiver.count()
@ -222,7 +224,7 @@ def _print_device(dev, num=None):
else: else:
mode = 'On-Board' mode = 'On-Board'
print(' Device Mode: %s' % mode) print(' Device Mode: %s' % mode)
elif feature == _hidpp20.FEATURE.BATTERY_STATUS or feature == _hidpp20.FEATURE.BATTERY_VOLTAGE: elif feature in (_F.BATTERY_STATUS, _F.BATTERY_VOLTAGE, _F.BATTERY_VOLTAGE):
print('', end=' ') print('', end=' ')
_battery_line(dev) _battery_line(dev)
for setting in dev_settings: for setting in dev_settings: