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

Fix command deserialization for getTokenData #619

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Apr 29, 2024

This is likely not the only place this error will be present (see #618). It looks like we were hiding a lot of deserialization errors in places where an unsuccessful command response will omit future fields.

[bellows.ezsp.protocol] Send command getTokenData: (<NV3KeyId.CREATOR_STACK_RESTORED_EUI64: 57642>, 0)
[bellows.ezsp.protocol] Failed to parse frame getTokenData: b'b5'

To fix this, I've temporarily set up command deserialization to work with Struct objects. We should migrate bellows to use Structs for all commands in the future, as it makes the interface much more ergonomic (see https://github.com/lhespress/zigpy-espzb/blob/b6e9dd5057015cdc4659a82b5a7174699c191041/zigpy_espzb/commands.py)

Related: home-assistant/core#116320 and home-assistant/core#116301.

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 99.65%. Comparing base (7833647) to head (e38b6d2).

❗ Current head e38b6d2 differs from pull request most recent head 4337a78. Consider uploading reports for the commit 4337a78 to get more accurate results

Files Patch % Lines
bellows/ezsp/protocol.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #619      +/-   ##
==========================================
- Coverage   99.67%   99.65%   -0.03%     
==========================================
  Files          74       74              
  Lines        4874     4881       +7     
==========================================
+ Hits         4858     4864       +6     
- Misses         16       17       +1     

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

@puddly puddly merged commit fbf754f into zigpy:dev Apr 29, 2024
12 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