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

Register the command response listener before writing to the UART #248

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Feb 9, 2024

See home-assistant/core#109931.

More precisely:

2024-02-08 00:17:53.874 DEBUG (MainThread) [zigpy.application] Feeding watchdog
2024-02-08 00:17:53.874 DEBUG (MainThread) [zigpy_deconz.api] Sending CommandId.write_parameter{'parameter_id': <NetworkParameter.watchdog_ttl: 38>, 'parameter': b'<\x00\x00\x00'} (seq=98)
2024-02-08 00:17:53.874 DEBUG (MainThread) [zigpy_deconz.uart] Send: 0b62000c000500263c000000
2024-02-08 00:17:53.876 DEBUG (MainThread) [zigpy_deconz.uart] Frame received: 0x0b62000800010026
2024-02-08 00:17:53.876 DEBUG (MainThread) [zigpy_deconz.api] Received command CommandId.write_parameter{'status': <Status.SUCCESS: 0>, 'frame_length': 8, 'payload_length': 1, 'parameter_id': <NetworkParameter.watchdog_ttl: 38>} (seq 98)
2024-02-08 00:17:55.675 DEBUG (MainThread) [zigpy_deconz.api] No response to 'CommandId.write_parameter' command with seq 98

It appears that we can write to the serial port and receive a response before the listener is registered a few lines down.

This is a bug probably exposed by us switching to pyserial-asyncio-fast.

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (df9c0c6) 98.69% compared to head (b29cb4f) 98.81%.
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #248      +/-   ##
==========================================
+ Coverage   98.69%   98.81%   +0.11%     
==========================================
  Files           7        7              
  Lines         920      925       +5     
==========================================
+ Hits          908      914       +6     
+ Misses         12       11       -1     

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

@puddly puddly merged commit 8d2315d into zigpy:dev Feb 16, 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.

None yet

1 participant