From 3d73ff5ae7a13b9ff75550a98dca63fa94b33d13 Mon Sep 17 00:00:00 2001 From: Hans-Werner Hilse Date: Tue, 2 Dec 2014 11:15:23 +0100 Subject: [PATCH] only open frontlight device on Kobo devices that actually have light --- frontend/device/kobo/powerd.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/device/kobo/powerd.lua b/frontend/device/kobo/powerd.lua index bd11c3898..656a71df6 100644 --- a/frontend/device/kobo/powerd.lua +++ b/frontend/device/kobo/powerd.lua @@ -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()