mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
pocketbook: fix for devices without natural light :p
This commit is contained in:
committed by
Martín Fernández
parent
671ea00a2f
commit
09e5143d2f
@@ -25,8 +25,10 @@ local PocketBookPowerD = BasePowerD:new{
|
||||
function PocketBookPowerD:init()
|
||||
-- needed for SetFrontlightState / GetFrontlightState
|
||||
inkview.OpenScreen()
|
||||
local color = inkview.GetFrontlightColor()
|
||||
self.fl_warmth = color >= 0 and color or 0
|
||||
if self.device:hasNaturalLight() then
|
||||
local color = inkview.GetFrontlightColor()
|
||||
self.fl_warmth = color >= 0 and color or 0
|
||||
end
|
||||
end
|
||||
|
||||
function PocketBookPowerD:frontlightIntensityHW()
|
||||
@@ -43,8 +45,10 @@ function PocketBookPowerD:setIntensityHW(intensity)
|
||||
end
|
||||
|
||||
function PocketBookPowerD:setWarmth(level)
|
||||
self.fl_warmth = level or self.fl_warmth
|
||||
inkview.SetFrontlightColor(self.fl_warmth)
|
||||
if self.fl_warmth then
|
||||
self.fl_warmth = level or self.fl_warmth
|
||||
inkview.SetFrontlightColor(self.fl_warmth)
|
||||
end
|
||||
end
|
||||
|
||||
function PocketBookPowerD:getCapacityHW()
|
||||
|
||||
Reference in New Issue
Block a user