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

@@ -43,10 +43,8 @@ local footerTextGeneratorMap = {
frontlight = function()
if not Device:hasFrontlight() then return "L: NA" end
local powerd = Device:getPowerDevice()
if powerd.is_fl_on ~= nil and powerd.is_fl_on == true then
if powerd.fl_intensity ~= nil then
return ("L: %d%%"):format(powerd.fl_intensity)
end
if powerd:isFrontlightOn() then
return ("L: %d%%"):format(powerd:frontlightIntensity())
else
return "L: Off"
end