You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(settings): store fan trip temperatures with a decimal so F round-trips
Fan temperatures are stored in C because that is what the kernel wants,
but a whole degree C cannot name every whole degree F: 85F rounds to
29C, which reads back as 84F. 60 of the 136 F values in the settable
range drift a degree that way, so a value entered in F frequently -- but
not always -- came back changed after a page reload.
The saved value now carries one decimal place. A tenth of a degree C is
0.18F, so the worst-case storage error is 0.09F and every whole degree F
survives the round trip; a value entered in C is still a whole number.
Two consumers assumed an integer and had to be fixed with it:
- applyThermalSettings() read the setting with getRawSettingInt(), whose
hand-rolled digit loop does not stop at a decimal point and turns
"29.4" into 2884. The kernel accepts the resulting 2884000-millidegree
trip write, so the fan would simply have stopped turning on after the
next boot. It now reads the raw string and parses a float.
- SetGPIOFanProperties() built millidegrees for the gpio-fan overlay by
appending "000" to the setting; it now multiplies.
Displaying in C also sets step="any" on the input, since a value holding
a tenth is invalid against the default step of 1. Existing whole-degree
values stay valid and stable -- they just aren't exact until re-entered.
Fixes#2840
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments