From 68aebc8c1b231a521e29c817930afa2463b13c22 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Tue, 1 Sep 2020 18:30:31 -0400 Subject: [PATCH] cli: slight improvement to probe --- lib/solaar/cli/probe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/solaar/cli/probe.py b/lib/solaar/cli/probe.py index 808d17c4..59246490 100644 --- a/lib/solaar/cli/probe.py +++ b/lib/solaar/cli/probe.py @@ -42,6 +42,7 @@ def run(receivers, args, find_receiver, _ignore): _print_receiver(receiver) + print('') print(' Register Dump') rgst = receiver.read_register(_R.notifications) print(' Notifications %#04x: %s' % (_R.notifications % 0x100, '0x' + _strhex(rgst) if rgst else 'None')) @@ -86,7 +87,7 @@ def run(receivers, args, find_receiver, _ignore): elif isinstance(rgst, int) and rgst == _hidpp10.ERROR.invalid_value: continue else: - if not isinstance(last, int) and not isinstance(rgst, int) and last != rgst: + if not isinstance(last, bytes) or not isinstance(rgst, bytes) or last != rgst: print( ' Register Short %#04x %#04x: %s' % (reg, sub, str(rgst) if isinstance(rgst, int) else '0x' + _strhex(rgst)) @@ -100,7 +101,7 @@ def run(receivers, args, find_receiver, _ignore): elif isinstance(rgst, int) and rgst == _hidpp10.ERROR.invalid_value: continue else: - if not isinstance(last, int) and not isinstance(rgst, int) and last != rgst: + if not isinstance(last, bytes) or not isinstance(rgst, bytes) or last != rgst: print( ' Register Long %#04x %#04x: %s' % (reg, sub, str(rgst) if isinstance(rgst, int) else '0x' + _strhex(rgst))