Skip to content

Commit

Permalink
Merge pull request #100 from Neradoc/get-last-received-report
Browse files Browse the repository at this point in the history
last_received_report will be removed in Circuitpython 8.0.0
  • Loading branch information
tekktrik authored Aug 18, 2022
2 parents 12e642b + 9a65eac commit 4d68643
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions adafruit_hid/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 4d68643

Please sign in to comment.