-
Notifications
You must be signed in to change notification settings - Fork 110
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
Air Quality API #464
Air Quality API #464
Conversation
I've written the base of air_quality API, next I will add a fake sensor for testing the API, including unit testing for the fake sensor
I've removed the `AirQualityListener` and used a `Cell<Option<(u32,)>>` instead. I've added a private Enum for choosing what kind of data reading to execute, a private method that uses this Enum and two other public functions as wrappers.
I've added a fake `AirQuality` driver and some integration tests for it. Every test is passed and should reflect the behaviour of the real driver.
I've added unittests for each function of the AirQuality API, all pass as expected. Documentation for the API will be part of the next commit.
Added the suggested changes, including the `read_sync` function that return a tuple of both CO2 and TVOC values. Improved the unittests for the fake driver and added a unittest for the new function.
I've added back the dedicated listener for this API and rewritten the returning errors of some functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
464: Air Quality API r=jrvanwhy a=RaresCon ### Pull Request Overview This PR adds an Air Quality API, which includes: - function for checking the existence of the driver - functions for initating readings for CO2 and TVOC levels - a private function and enum for synchronous reading of values for CO2 and TVOC levels and 3 public functions for easier use of the API - unit tests Alongside the API, this PR adds a fake driver (and unit tests for it) for testing the API. ### Testing Strategy This pull request was tested using unit tests made specifically for this API and fake driver. ### TODO or Help Wanted This pull request still needs feedback / code review. I will add documentation in the files and an example application using this API. ### Documentation Updated - [x] No updates required. Co-authored-by: RaresCon <rares.constantin2002@gmail.com> Co-authored-by: Rareș Constantin <95525840+RaresCon@users.noreply.github.com>
Build failed: |
I've added some documentation for the functions of the API and fixed an inclusion bug of the API in `tests.rs` that made the CI fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Pull Request Overview
This PR adds an Air Quality API, which includes:
Alongside the API, this PR adds a fake driver (and unit tests for it) for testing the API.
Testing Strategy
This pull request was tested using unit tests made specifically for this API and fake driver.
TODO or Help Wanted
This pull request still needs feedback / code review.
I will add documentation in the files and an example application using this API.
Documentation Updated