device: allow for None reponse from kind request

This commit is contained in:
Peter F. Patel-Schneider 2021-08-25 10:12:12 -04:00
parent 3ef5e63cd4
commit 2f870fe0f7
1 changed files with 2 additions and 1 deletions

View File

@ -257,7 +257,8 @@ class Device(object):
kind = ord(pair_info[7:8]) & 0x0F kind = ord(pair_info[7:8]) & 0x0F
self._kind = _hidpp10.DEVICE_KIND[kind] self._kind = _hidpp10.DEVICE_KIND[kind]
elif self.online and self.protocol >= 2.0: elif self.online and self.protocol >= 2.0:
self._kind = KIND_MAP[_hidpp20.get_kind(self)] kind = _hidpp20.get_kind(self)
self._kind = KIND_MAP[kind] if kind else None
return self._kind or '?' return self._kind or '?'
@property @property