Skip to content

Commit

Permalink
device: handle unknown device kinds
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Jul 2, 2024
1 parent 71d2a50 commit e63b80d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/logitech_receiver/hidpp20.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,10 @@ def get_kind(self, device: Device):
kind = device.feature_request(FEATURE.DEVICE_NAME, 0x20)
if kind:
kind = ord(kind[:1])
return KIND_MAP[DEVICE_KIND[kind]]
try:
return KIND_MAP[DEVICE_KIND[kind]]
except Exception:
return None

def get_name(self, device: Device):
"""Reads a device's name.
Expand Down

0 comments on commit e63b80d

Please sign in to comment.