mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
add battery status pulling functions in KoboPowerD
Status files found at http://www.mobileread.com/forums/showpost.php?p=1750642&postcount=9.
This commit is contained in:
@@ -5,6 +5,11 @@ local KoboPowerD = BasePowerD:new{
|
||||
flIntensity = 20,
|
||||
restore_settings = true,
|
||||
fl = nil,
|
||||
|
||||
batt_capacity_file = "/sys/devices/platform/pmic_battery.1/power_supply/mc13892_bat/capacity",
|
||||
is_charging_file = "/sys/devices/platform/pmic_battery.1/power_supply/mc13892_bat/charge_now",
|
||||
battCapacity = nil,
|
||||
is_charging = nil,
|
||||
}
|
||||
|
||||
function KoboPowerD:init()
|
||||
@@ -23,4 +28,14 @@ function KoboPowerD:setIntensityHW()
|
||||
end
|
||||
end
|
||||
|
||||
function KoboPowerD:getCapacityHW()
|
||||
self.battCapacity = self:read_int_file(self.batt_capacity_file)
|
||||
return self.battCapacity
|
||||
end
|
||||
|
||||
function KoboPowerD:isChargingHW()
|
||||
self.is_charging = self:read_int_file(self.is_charging_file)
|
||||
return self.is_charging == 1
|
||||
end
|
||||
|
||||
return KoboPowerD
|
||||
|
||||
Reference in New Issue
Block a user