Skip to content

Commit 4d68643

Browse files
authored
Merge pull request #100 from Neradoc/get-last-received-report
last_received_report will be removed in Circuitpython 8.0.0
2 parents 12e642b + 9a65eac commit 4d68643

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_hid/keyboard.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def _remove_keycode_from_report(self, keycode: int) -> None:
162162
@property
163163
def led_status(self) -> bytes:
164164
"""Returns the last received report"""
165-
return self._keyboard_device.last_received_report
165+
# get_last_received_report() returns None when nothing was received
166+
return self._keyboard_device.get_last_received_report() or b"\x00"
166167

167168
def led_on(self, led_code: int) -> bool:
168169
"""Returns whether an LED is on based on the led code
@@ -174,7 +175,7 @@ def led_on(self, led_code: int) -> bool:
174175
from adafruit_hid.keycode import Keycode
175176
import time
176177
177-
# Initialize Keybaord
178+
# Initialize Keyboard
178179
kbd = Keyboard(usb_hid.devices)
179180
180181
# Press and release CapsLock.

0 commit comments

Comments
 (0)