Add support for DFRobot DFR0300 EC sensor (using DFRobot DFR0566 Raspberry PI expansion HAT) #425
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.
This adds support for the DFR0300 EC sensor
The sensor needs an ADC, so this PR also adds support for the DFRobot DFR0566 Raspberry PI expansion HAT, which is then available to any other sensors that require it, and provides pin sockets for DFRobot Analog, Digital, I2C, PWM preipherals.
As the DFR0566 is effectively a driver, it has been added to a separate
drivers
directory in thesensors
directory so it can be used by other sensors, and other driver code could be added as needed.For optimal accuracy, the DFR0300 needs to read the current temperature from another sensor, so this PR also adds the
event_bus
argument tosetup_sensor
, so that in future, all sensors will be able to query the event bus for any events they may need to subscribe to.This has required changing the code for all other sensors that call
setup_sensor
.