mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
Kobo: Handle a few PowerCover quirks...
* The first few capacity reads after connecting to the cover may fail * The PowerCover may trigger spurious move/add usb_plug uevent, which translate into Charging events for us. Instead of blindly lighting up the charging LED on those, check if the device is actually charging, first.
This commit is contained in:
@@ -387,7 +387,7 @@ local KoboIo = Kobo:new{
|
||||
},
|
||||
}
|
||||
|
||||
function Kobo:_refreshChargingLED()
|
||||
function Kobo:setupChargingLED()
|
||||
if G_reader_settings:nilOrTrue("enable_charging_led") then
|
||||
if self:hasAuxBattery() and self.powerd:isAuxBatteryConnected() then
|
||||
self:toggleChargingLED(self.powerd:isAuxCharging())
|
||||
@@ -512,7 +512,7 @@ function Kobo:init()
|
||||
-- We have no way of querying the current state of the charging LED, so, start from scratch.
|
||||
-- Much like Nickel, start by turning it off.
|
||||
self:toggleChargingLED(false)
|
||||
self:_refreshChargingLED()
|
||||
self:setupChargingLED()
|
||||
|
||||
-- Only enable a single core on startup
|
||||
self:enableCPUCores(1)
|
||||
@@ -888,7 +888,7 @@ function Kobo:resume()
|
||||
end
|
||||
|
||||
-- A full suspend may have toggled the LED off.
|
||||
self:_refreshChargingLED()
|
||||
self:setupChargingLED()
|
||||
end
|
||||
|
||||
function Kobo:saveSettings()
|
||||
|
||||
Reference in New Issue
Block a user