Merge pull request #1323 from hwhw/master

only open frontlight device on Kobo devices that actually have light
pull/1324/head
Huang Xin 10 years ago
commit d9b661ffa7

@ -13,10 +13,12 @@ local KoboPowerD = BasePowerD:new{
} }
function KoboPowerD:init() function KoboPowerD:init()
if self.device.hasFrontlight() then
local kobolight = require("ffi/kobolight") local kobolight = require("ffi/kobolight")
local ok, light = pcall(kobolight.open) local ok, light = pcall(kobolight.open)
if ok then self.fl = light end if ok then self.fl = light end
end end
end
function KoboPowerD:toggleFrontlight() function KoboPowerD:toggleFrontlight()
if self.fl ~= nil then if self.fl ~= nil then

Loading…
Cancel
Save