mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-06-08 16:08:21 +02:00
Move a hack about the fully charged level from g-p-m
This commit is contained in:
parent
37767c77bb
commit
bbd289ee81
1 changed files with 8 additions and 0 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#define DKP_DEVICE_SUPPLY_REFRESH_TIMEOUT 30 /* seconds */
|
||||
#define DKP_DEVICE_SUPPLY_UNKNOWN_TIMEOUT 2 /* seconds */
|
||||
#define DKP_DEVICE_SUPPLY_UNKNOWN_RETRIES 30
|
||||
#define DKP_DEVICE_SUPPLY_CHARGED_THRESHOLD 95.0f /* % */
|
||||
|
||||
struct DkpDeviceSupplyPrivate
|
||||
{
|
||||
|
|
@ -522,6 +523,13 @@ dkp_device_supply_refresh_battery (DkpDeviceSupply *supply)
|
|||
percentage = 100.0f;
|
||||
}
|
||||
|
||||
/* some batteries stop charging much before 100% */
|
||||
if (state == DKP_DEVICE_STATE_UNKNOWN &&
|
||||
percentage > DKP_DEVICE_SUPPLY_CHARGED_THRESHOLD) {
|
||||
egg_warning ("fixing up unknown %f", percentage);
|
||||
state = DKP_DEVICE_STATE_FULLY_CHARGED;
|
||||
}
|
||||
|
||||
/* calculate a quick and dirty time remaining value */
|
||||
time_to_empty = 0;
|
||||
time_to_full = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue