Unverified Commit b6a7189c authored by Mark Vander Stel's avatar Mark Vander Stel
Browse files

Fix high temp values sticking

Broken in commit 4c81ef40, if a
temperature was ever recorded above the threshold, _lp_temperature()
would always return that high value, never resetting.

Fixes #686
parent 97f6bfad
......@@ -2615,6 +2615,7 @@ __lp_temp_detect() {
_lp_temperature() {
(( LP_ENABLE_TEMP )) || return 2
unset lp_temperature
"$_LP_TEMP_FUNCTION"
[[ -z ${lp_temperature-} ]] && return 1
......
......@@ -96,7 +96,10 @@ function test_acpi_temperature {
# While we should never be in this situation, might as well make sure
# it doesn't crash.
_LP_TEMP_FUNCTION=__lp_temp_acpi
unset lp_temperature
# This is to test that _lp_temperature() ignores previous high values
lp_temperature=10000
_lp_temperature
assertEquals "ACPI temperature return at index ${index}" "$valid" "$?"
assertEquals "ACPI temperature return output at index ${index}" "${temp_values[$index]}" "${lp_temperature-}"
......
......@@ -269,7 +269,10 @@ function test_sensors {
# While we should never be in this situation, might as well make sure
# it doesn't crash.
_LP_TEMP_FUNCTION=__lp_temp_sensors
unset lp_temperature
# This is to test that _lp_temperature() ignores previous high values
lp_temperature=10000
_lp_temperature
assertEquals "Sensors temperature return at index ${index}" "$valid" "$?"
assertEquals "Sensors temperature return output at index ${index}" "${values[$index]}" "${lp_temperature-}"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment