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

Reduce command duplication #635

Merged
merged 7 commits into from
Jul 22, 2024

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Jul 21, 2024

This PR finishes the "derives from the previous version" format that we've been using for EZSP v8-v14.

Copy link

codecov bot commented Jul 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.15%. Comparing base (91b8f37) to head (18d1d52).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #635   +/-   ##
=======================================
  Coverage   99.15%   99.15%           
=======================================
  Files          50       50           
  Lines        3412     3447   +35     
=======================================
+ Hits         3383     3418   +35     
  Misses         29       29           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@puddly
Copy link
Contributor Author

puddly commented Jul 21, 2024

I believe that 18d1d52 is going to be a safe change: I've not seen a single SDK version where the sent command parameter is actually 16 bits. The SDK uses 16-bit integer constants but the command is always serialized and deserialized to/from an 8-bit integer. I think the fact that EZSP is lenient with command payload lengths and that we use little endian encoding has sort of "hidden" this problem:

In [1]: (0x0012).to_bytes(2, 'little')
Out[1]: b'\x12\x00'

In [2]: (0x0012).to_bytes(1, 'little')
Out[2]: b'\x12'

@puddly puddly merged commit 64ba03d into zigpy:dev Jul 22, 2024
14 checks passed
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.

1 participant