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 type should be used whenever a sensor (or actuator?) works with a
temperature. For example, this commit changes the signature:
to the following:
I believe this is much clearer in intent. It also makes it trivial to
introduce common conversions. For example, there are already Celsius()
and Fahrenheit() methods to convert to the given units, as a floating
point. More units could be added as needed, for example a CelsiusInt().
This PR has a few possibly controversial changes:
ReadTempC
andReadTempF
functions from the adt7410 driver because those are now unnecessaryI am aware that this is a breaking change. However, we use versioning and Go modules for a reason, and I think this change will improve the drivers in general. I intend to also apply a similar change to other units such as pressure (and maybe acceleration etc.)