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

Sensors can determine precision of their magnitudes #1648

Merged
merged 1 commit into from
Mar 25, 2019

Conversation

CraigMarkwardt
Copy link
Contributor

Currently espurna magnitude precisions are hard-coded in sensor.ino. For example the default temperature precision is whole integer degrees Celsius. This causes sensors such as the Dallas DS18B20 to miss 3 digits of extra precision.

This change modifies BaseSensor so that each sensor class can specify the number of decimals to represent its magnitude types. If the sensor does not override this virtual method, the default is to use the sensors.ino hard-coded values (i.e. fall back on previous method).

I also updated sensors BMX280 and Dallas OneWire are with the specified precision knowledge; tested with BME280 and Dallas DS18B20 sensors

…resent its magnitude types; update sensor.ino to take advantage of this knowledge; sensors BMX280 and Dallas OneWire are updated with this knowledge; tested with BME280 and Dallas DS18B20 sensors
@xoseperez
Copy link
Owner

LGTM. Thank you very much!

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

2 participants