-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
last_received_report will be removed in Circuitpython 8.0.0 #100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment before approving!
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation says that last_received_report
also returned None
, so is the or b"\00"
just a bugfix? I'm assuming it MUST be a bytes
object return instead of Optional
based on usage in led_on
. Just wanted to check before merging so I get the semver correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it makes the code compatible with the documentation. In reality last_received_report
and get_last_received_report()
never return None as currently implemented, but I added that to future-proof it a little in case that's fixed.
There might be bigger changes coming in 8.0.0 though, so that might be revisited soon.
See adafruit/circuitpython#6767
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks for explaining!
Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4040 to 1.2.12 from 1.2.11: > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4040#15 from sokratisvas/add-type-annotations > Fix version strings in workflow files > Update version string Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 5.3.0 from 5.2.5: > Merge pull request adafruit/Adafruit_CircuitPython_HID#100 from Neradoc/get-last-received-report > Fix version strings in workflow files > Update version string Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.4.0 from 5.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#116 from vladak/socket_timeout_tunable > Fix version strings in workflow files > Update version string
Switch to get_last_received_report().