2
0
mirror of https://github.com/koreader/koreader synced 2024-11-04 12:00:25 +00:00
koreader/frontend/ui/device/kobofrontlight.lua
2013-10-18 22:38:07 +02:00

29 lines
509 B
Lua

local BaseFrontLight = require("ui/device/basefrontlight")
local KoboFrontLight = {
min = 1, max = 100,
intensity = 20,
restore_settings = true,
fl = nil,
}
function KoboFrontLight:init()
self.fl = kobolight.open()
end
function KoboFrontLight:toggle()
if self.fl ~= nil then
self.fl:toggle()
end
end
KoboFrontLight.setIntensity = BaseFrontLight.setIntensity
function KoboFrontLight:setIntensityHW()
if self.fl ~= nil then
self.fl:setBrightness(self.intensity)
end
end
return KoboFrontLight