mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #625 from hwhw/master
fail gracefully when the Kobo light device cannot be opened
This commit is contained in:
@@ -13,7 +13,8 @@ local KoboPowerD = BasePowerD:new{
|
||||
}
|
||||
|
||||
function KoboPowerD:init()
|
||||
self.fl = kobolight.open()
|
||||
local ok, light = pcall(kobolight.open)
|
||||
if ok then self.fl = light end
|
||||
end
|
||||
|
||||
function KoboPowerD:toggleFrontlight()
|
||||
|
||||
Reference in New Issue
Block a user