mirror of
https://github.com/koreader/koreader
synced 2024-11-04 12:00:25 +00:00
29 lines
509 B
Lua
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
|