diff --git a/adafruit_hid/keyboard.py b/adafruit_hid/keyboard.py index f1240c3..ad46ef6 100644 --- a/adafruit_hid/keyboard.py +++ b/adafruit_hid/keyboard.py @@ -162,7 +162,8 @@ def _remove_keycode_from_report(self, keycode: int) -> None: @property def led_status(self) -> bytes: """Returns the last received report""" - return self._keyboard_device.last_received_report + # get_last_received_report() returns None when nothing was received + return self._keyboard_device.get_last_received_report() or b"\x00" def led_on(self, led_code: int) -> bool: """Returns whether an LED is on based on the led code @@ -174,7 +175,7 @@ def led_on(self, led_code: int) -> bool: from adafruit_hid.keycode import Keycode import time - # Initialize Keybaord + # Initialize Keyboard kbd = Keyboard(usb_hid.devices) # Press and release CapsLock.