device/kobo/powerd: Read natural light configuration

Define 'frontlight_settings' table for all Kobo devices, and read
configuration from settings file.
pull/3751/head v2018.03.14-beta
David Engster 6 years ago committed by Frans de Jonge
parent 51b6e1625e
commit bfd55c76c2

@ -32,6 +32,7 @@ local Kobo = Generic:new{
internal_storage_mount_point = "/mnt/onboard/",
-- currently only Aura One has coloured frontlight
hasNaturalLight = no,
frontlight_settings = {},
}
-- TODO: hasKeys for some devices?

@ -97,6 +97,12 @@ function KoboPowerD:init()
-- If this device has natural light (currently only KA1)
-- use the SysFS interface, and ioctl otherwise.
if self.device.hasNaturalLight() then
local nl_config = G_reader_settings:readSetting("natural_light_config")
if nl_config then
for key,val in pairs(nl_config) do
self.device.frontlight_settings[key] = val
end
end
self.fl = SysfsLight:new(self.device.frontlight_settings)
self.fl_warmth = 0
self:_syncKoboLightOnStart()

Loading…
Cancel
Save