widbattpwr: scale time based on (estimated) remaining battery mAh
parent
487652cc1a
commit
f943effe39
|
|
@ -43,7 +43,7 @@
|
|||
txt = "".concat(batt, "%");
|
||||
}
|
||||
else {
|
||||
var hrs = 200000 / usage;
|
||||
var hrs = 175000 * batt / (100 * usage);
|
||||
var days = hrs / 24;
|
||||
txt = days >= 1 ? "".concat(Math.round(Math.min(days, 99)), "d") : "".concat(Math.round(hrs), "h");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@
|
|||
if(showPct){
|
||||
txt = `${batt}%`;
|
||||
}else{
|
||||
const hrs = 200000 / usage;
|
||||
// 175mAh, scaled based on battery (batt/100), scaled down based on usage
|
||||
const hrs = 175000 * batt / (100 * usage);
|
||||
const days = hrs / 24;
|
||||
txt = days >= 1 ? `${Math.round(Math.min(days, 99))}d` : `${Math.round(hrs)}h`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue