Fix sensor data retrieval for Broadlink A2 devices #826
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there 👋
This PR fixes an issue that prevented Broadlink A2 air quality sensors from returning correct data. The problem was due to an incorrectly formatted packet being sent to the device when requesting sensor readings.
I’ve updated the request packet structure so that the device now responds with valid and complete data. This includes temperature, humidity, and PM10/2.5/1. The fix has been tested on a real A2 unit (4f60) and is working as expected.
Thanks for your time and effort maintaining this project! Please let me know if anything needs adjustment.
Best regards,
Kan
Context
The Broadlink A2 air quality sensor was previously unable to return valid data because the library sent incorrectly formatted request packets to the device. As a result, the response was shown as Error -5.
Proposed change
Corrected the format of the packet sent to A2 devices when requesting sensor data. With this fix, the device responds with valid data that can be parsed as expected (temperature, humidity, air quality, etc.).
Type of change
Additional information
Checklist