AutoFrontlight plugin (#2941)

* Add AutoFrontlight plugin

* Add configuration to control autofrontlight feature
This commit is contained in:
Hzj_jie
2017-06-14 10:32:16 -07:00
committed by Frans de Jonge
parent ed0ba6737e
commit 53eb4dee50
18 changed files with 639 additions and 137 deletions

View File

@@ -38,10 +38,7 @@ function FrontLightWidget:init()
local powerd = Device:getPowerDevice()
self.fl_min = powerd.fl_min
self.fl_max = powerd.fl_max
self.fl_cur = powerd.fl_intensity
if self.fl_cur == nil then
self.fl_cur = self.fl_min
end
self.fl_cur = powerd:frontlightIntensity()
local steps_fl = self.fl_max - self.fl_min + 1
self.one_step = math.ceil(steps_fl / 25)
self.steps = math.ceil(steps_fl / self.one_step)