mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-06-09 20:08:34 +02:00
openbsd: fix energy-rate calculation
since acpibat.c r1.59, bst_rate type is SENSOR_AMPS or SENSOR_WATTS and value has been corrected. Tweak accordingly. Signed-off-by: Richard Hughes <richard@hughsie.com>
This commit is contained in:
parent
60e474ead5
commit
37ff0d4ddb
1 changed files with 5 additions and 3 deletions
|
|
@ -375,8 +375,10 @@ up_backend_update_acpibat_state(UpDevice* device, struct sensordev s)
|
|||
typev = sens.type;
|
||||
bst_cap = sens.value / 1000000.0f;
|
||||
}
|
||||
if (sens.type == SENSOR_INTEGER && !strcmp(sens.desc, "rate"))
|
||||
bst_rate = sens.value / 1000.0f;
|
||||
if ((sens.type == SENSOR_AMPS || sens.type == SENSOR_WATTS) && !strcmp(sens.desc, "rate")) {
|
||||
typev = sens.type;
|
||||
bst_rate = sens.value / 1000000.0f;
|
||||
}
|
||||
/*
|
||||
bif_dvolt = "voltage" = unused ?
|
||||
capacity = lastfull/dcap * 100 ?
|
||||
|
|
@ -386,7 +388,7 @@ up_backend_update_acpibat_state(UpDevice* device, struct sensordev s)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (typev == SENSOR_AMPHOUR) {
|
||||
if (typev == SENSOR_AMPHOUR || typev == SENSOR_AMPS) {
|
||||
bst_cap *= bst_volt;
|
||||
bif_lowcap *= bst_volt;
|
||||
bif_lastfullcap *= bst_volt;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue