fix bytearray.startswith not available in CircuitPython
This commit is contained in:
parent
b6201d43d4
commit
f90de872d8
@ -126,8 +126,7 @@ class AbstractHID:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def send(self):
|
def send(self):
|
||||||
changed = not self._evt.startswith(self._prev_evt)
|
if self._evt != self._prev_evt:
|
||||||
if changed:
|
|
||||||
self._prev_evt[:] = self._evt
|
self._prev_evt[:] = self._evt
|
||||||
self.hid_send(self._evt)
|
self.hid_send(self._evt)
|
||||||
|
|
||||||
|
@ -58,6 +58,8 @@ class KeyboardTest:
|
|||||||
for hid_report in hid_send_call_arg_list:
|
for hid_report in hid_send_call_arg_list:
|
||||||
print(hid_report)
|
print(hid_report)
|
||||||
|
|
||||||
|
assert len(hid_send_call_arg_list) >= len(assert_hid_reports)
|
||||||
|
|
||||||
for i, hid_report in enumerate(
|
for i, hid_report in enumerate(
|
||||||
hid_send_call_arg_list[-len(assert_hid_reports) :]
|
hid_send_call_arg_list[-len(assert_hid_reports) :]
|
||||||
):
|
):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user