[UX] plugins/kobolight: Handle automatic warmth

If warmth is handled automatically, do not try to change warmth but
display a message instead.
This commit is contained in:
David Engster
2018-03-31 16:08:52 +02:00
committed by Frans de Jonge
parent daa1f466ff
commit ba46376299

View File

@@ -199,10 +199,18 @@ function KoboLight:onSwipe(_, ges)
return true
end
function KoboLight:onSwipeWarmth(_, ges)
function KoboLight:onSwipeWarmth(ignored, ges)
local powerd = Device:getPowerDevice()
if powerd.fl_warmth == nil then return false end
if powerd.auto_warmth then
UIManager:show(Notification:new{
text = _("Warmth is handled automatically."),
timeout = 1.0,
})
return true
end
local step = math.ceil(#self.steps * ges.distance / self.gestureScale)
local delta_int = self.steps[step] or self.steps[#self.steps]
local warmth