mirror of https://github.com/koreader/koreader
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
509 B
Lua
29 lines
509 B
Lua
11 years ago
|
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
|