The major point of this PR is to add an option to show a single decimal place in the temperature display. While most sensors only yield integer values, there are some which at least can supply 0.5 increments.
Current Behavior
Temperatures are processed as in integer steps. unit: 1 degree celcius
Updated Behavior
Temperatures are still technically stored as integers, but the new unit is a tenth of a degree. This allows to support higher precision sensors while still using integer arithmetics
A checkbox is added to control whether the first decimal position is shown
The UI still uses full degrees as unit and also stores the configured values as such. Therefore existing config values should still work as expected.
Minor Addition: Support for OTHER input files
This PR also adds logic to use an arbitrary file as sensor (called raw in the code), which works the same as reading a temperature from a file under /sys/class/thermal. Reading from arbitrary locations was already possible before by exploiting the logic, as the checks would treat a folder at an unexpected path as if it were under /proc/. You could previously e.g. create a file under /home/alice/mysensors/temperature with this content:
temperature: 80 C
and point the plugin to /home/alice/mysensors to read this 80 C value. The new behavior is to first check for the /sys/ and /proc prefixes explicitly, and if none applies, treat the passed path as a filepath with a format as used in /sys/class/thermal. You can e.g. create the file /home/alice/outside_temp with the content
25300
and pass the full path /home/alice/outside_temp to read this as 25.3 C. This can be paired with a background script to e.g. query non-internal sensors, web-APIs etc.
Minor Addition: Disambiguate temperatures from error code
Currently, temperature-returning functions return -1 upon error. While internal sensors will usually not encounter negative temperatures, this may be ambiguous now that we support OTHER files. Therefore the new error code is set to a number below absolute zero.
The major point of this PR is to add an option to show a single decimal place in the temperature display. While most sensors only yield integer values, there are some which at least can supply 0.5 increments.
Current Behavior
Updated Behavior
Minor Addition: Support for OTHER input files
This PR also adds logic to use an arbitrary file as sensor (called
raw
in the code), which works the same as reading a temperature from a file under/sys/class/thermal
. Reading from arbitrary locations was already possible before by exploiting the logic, as the checks would treat a folder at an unexpected path as if it were under/proc/
. You could previously e.g. create a file under/home/alice/mysensors/temperature
with this content:and point the plugin to
/home/alice/mysensors
to read this 80 C value. The new behavior is to first check for the/sys/
and/proc
prefixes explicitly, and if none applies, treat the passed path as a filepath with a format as used in/sys/class/thermal
. You can e.g. create the file/home/alice/outside_temp
with the contentand pass the full path
/home/alice/outside_temp
to read this as 25.3 C. This can be paired with a background script to e.g. query non-internal sensors, web-APIs etc.Minor Addition: Disambiguate temperatures from error code
Currently, temperature-returning functions return -1 upon error. While internal sensors will usually not encounter negative temperatures, this may be ambiguous now that we support OTHER files. Therefore the new error code is set to a number below absolute zero.