mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
only open frontlight device on Kobo devices that actually have light
This commit is contained in:
@@ -13,9 +13,11 @@ local KoboPowerD = BasePowerD:new{
|
||||
}
|
||||
|
||||
function KoboPowerD:init()
|
||||
local kobolight = require("ffi/kobolight")
|
||||
local ok, light = pcall(kobolight.open)
|
||||
if ok then self.fl = light end
|
||||
if self.device.hasFrontlight() then
|
||||
local kobolight = require("ffi/kobolight")
|
||||
local ok, light = pcall(kobolight.open)
|
||||
if ok then self.fl = light end
|
||||
end
|
||||
end
|
||||
|
||||
function KoboPowerD:toggleFrontlight()
|
||||
|
||||
Reference in New Issue
Block a user