-
-
Notifications
You must be signed in to change notification settings - Fork 717
Kelvin option for module internal/temperature and more accurate calculation of the temperature in °F #2784
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
Conversation
I tested my changes on Linux Mint, and it works perfectly. My main distro is NixOS, but I haven't figured out how to build stuff there yet. |
Codecov Report
@@ Coverage Diff @@
## master #2784 +/- ##
==========================================
- Coverage 13.52% 13.51% -0.01%
==========================================
Files 152 152
Lines 11396 11401 +5
==========================================
Hits 1541 1541
- Misses 9855 9860 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
ok i have no idea what this means lol |
What what means? |
Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
the codecov thingy |
it now uses float as a initial value and makes m_temp temp_k and temp_f by converting and rounding with std::round
I see. That reports how this PR affects our code coverage. Doesn't really matter here since we don't have any tests for module behavior yet. |
@@ -51,22 +51,27 @@ namespace modules { | |||
} | |||
|
|||
bool temperature_module::update() { | |||
m_temp = std::strtol(file_util::contents(m_path).c_str(), nullptr, 10) / 1000.0f + 0.5f; | |||
int temp_f = floor(((1.8 * m_temp) + 32) + 0.5); | |||
float temp = float(std::strtol(file_util::contents(m_path).c_str(), nullptr, 10)) / 1000.0; |
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.
Nice. Computations on floats make much more sense here :)
thanks :) |
Thank your for contributing and also cleaning up some of our code ;) |
What type of PR is this? (check all applicable)
Description
implements temperature in Kelvin for the temperature module
Related Issues & Documents
implements idea #2774
Documentation (check all applicable)