[Kindle] Fix setting absolute warmth without breaking incremental settings (#13344)

Closes #13331.
This commit is contained in:
mergen3107 authored and GitHub committed 2026-03-19 14:23:14 +01:00
1 parent dfc45a8fc0
commit 8def50f218
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -143,7 +143,7 @@ if Device:hasFrontlight() then
-- do the computations in the native scale, to ensure we always actually *change* something,
-- in case both the old and new value would round to the same native step,
-- despite being different in the API scale, which is stupidly fixed at [0, 100]...
local warmth = powerd:fromNativeWarmth(powerd:toNativeWarmth(powerd:frontlightWarmth()) + delta)
local warmth = powerd:toNativeWarmth(powerd:frontlightWarmth()) + delta
self:onSetFlWarmth(warmth)
self:onShowWarmth()
@@ -157,7 +157,7 @@ if Device:hasFrontlight() then
elseif warmth < 0 then
warmth = 0
end
powerd:setWarmth(warmth)
powerd:setWarmth(powerd:fromNativeWarmth(warmth))
return true
end
+1 -1
View File
@@ -121,7 +121,7 @@ local settingsList = {
set_frontlight = {category="absolutenumber", event="SetFlIntensity", min=0, max=Device:getPowerDevice().fl_max, title=_("Set frontlight brightness"), screen=true, condition=Device:hasFrontlight()},
increase_frontlight = {category="incrementalnumber", event="IncreaseFlIntensity", min=1, max=Device:getPowerDevice().fl_max, title=_("Increase frontlight brightness"), screen=true, condition=Device:hasFrontlight()},
decrease_frontlight = {category="incrementalnumber", event="DecreaseFlIntensity", min=1, max=Device:getPowerDevice().fl_max, title=_("Decrease frontlight brightness"), screen=true, condition=Device:hasFrontlight()},
set_frontlight_warmth = {category="absolutenumber", event="SetFlWarmth", min=0, max=100, title=_("Set frontlight warmth"), screen=true, condition=Device:hasNaturalLight()},
set_frontlight_warmth = {category="absolutenumber", event="SetFlWarmth", min=1, max=Device:getPowerDevice().fl_max, title=_("Set frontlight warmth"), screen=true, condition=Device:hasNaturalLight()},
increase_frontlight_warmth = {category="incrementalnumber", event="IncreaseFlWarmth", min=1, max=Device:getPowerDevice().fl_warmth_max, title=_("Increase frontlight warmth"), screen=true, condition=Device:hasNaturalLight()},
decrease_frontlight_warmth = {category="incrementalnumber", event="DecreaseFlWarmth", min=1, max=Device:getPowerDevice().fl_warmth_max, title=_("Decrease frontlight warmth"), screen=true, condition=Device:hasNaturalLight(), separator=true},
night_mode = {category="none", event="ToggleNightMode", title=_("Toggle night mode"), screen=true},