Add sleep support for Nova Fitness SDS011 sensor - #2387
Conversation
|
Nice! Defaults are indeed rough I wonder though, would it be enough to just add small func doing the serial writing + reading response by ourselves instead of using the lib? ref. https://cdn.sparkfun.com/assets/parts/1/2/2/7/5/Laser_Dust_Sensor_Control_Protocol_V1.3.pdf in the Also, don't we want the setting to be using minutes directly? Regardless of the implementation, library or custom code. Sensor does not have sub-minute setting anyway, just another possible bug when we will try to use numbers like 300 in uint8_t and overflow things by accident |
The Nova Fitness SDS011 sensor has a limited lifespan time of 8000 hours, or roughly 1 year of continuous operation. This lifespan can be largely extended if the sensor is configured to sleep for a certain amount of time (the so called 'working cycles'), wake up to take a measurement, and then going back to sleep again.
This PR changes the default behaviour of this integration to benefit from these working cycles as users might inadvertently be 'killing' their sensors by an overly aggressive continuous reading strategy.