Skip to content
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

Merged
merged 3 commits into from
Aug 18, 2022

Conversation

Neradoc
Copy link
Contributor

@Neradoc Neradoc commented Aug 16, 2022

Switch to get_last_received_report().

Copy link
Member

@tekktrik tekktrik left a 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"
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

@tekktrik tekktrik left a 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!

@tekktrik tekktrik merged commit 4d68643 into adafruit:main Aug 18, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 19, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants