device: warn when feature notifiation comes in before device fully set up

This commit is contained in:
Peter F. Patel-Schneider 2020-11-01 08:54:26 -05:00
parent 733bf913e6
commit d92939135f
1 changed files with 3 additions and 1 deletions

View File

@ -125,7 +125,9 @@ def _process_device_notification(device, status, n):
return _process_hidpp10_custom_notification(device, status, n)
# assuming 0x00 to 0x3F are feature (HID++ 2.0) notifications
assert device.features
if not device.features:
_log.warn('%s: feature notification but features not set up: %02X %s', device, n.sub_id, n)
return False
try:
feature = device.features[n.sub_id]
except IndexError: