improved hid++ support
This commit is contained in:
parent
33a9ca060d
commit
d38bec39b6
|
@ -195,6 +195,7 @@ def read(device_handle, bytes_count, timeout_ms=-1):
|
|||
if rlist:
|
||||
assert rlist == [device_handle]
|
||||
data = _os.read(device_handle, bytes_count)
|
||||
assert data is not None
|
||||
return data
|
||||
else:
|
||||
return b''
|
||||
|
|
|
@ -252,7 +252,7 @@ class Receiver(object):
|
|||
return False
|
||||
if enable:
|
||||
# set all possible flags
|
||||
ok = self.request(0x8000, 0xFF, 0xFF) # and self.request(0x8002, 0x02)
|
||||
ok = self.request(0x8000, 0xFF, 0xFF, 0xFF)
|
||||
else:
|
||||
# clear out all possible flags
|
||||
ok = self.request(0x8000)
|
||||
|
|
|
@ -193,9 +193,15 @@ class DeviceStatus(dict):
|
|||
|
||||
return True
|
||||
|
||||
if event.sub_id == 0x49:
|
||||
# raw input event? just ignore it
|
||||
# if event.address == 0x01, no idea what it is
|
||||
# if event.address == 0x03, it's an actual input event
|
||||
return True
|
||||
|
||||
if event.sub_id == 0x4B:
|
||||
if event.address == 0x01:
|
||||
_log.debug("device came online? %d", event.devnumber)
|
||||
_log.debug("device came online %d", event.devnumber)
|
||||
self._changed(alert=ALERT.LOW, reason='powered on')
|
||||
else:
|
||||
_log.warn("unknown event %s", event)
|
||||
|
|
Loading…
Reference in New Issue