take out the suffix from the chip until we actually have a way of knowing if the bettery is actually charging
This commit is contained in:
parent
612a8da0f7
commit
8dad7ae38b
1 changed files with 13 additions and 11 deletions
|
|
@ -71,17 +71,19 @@ export function describePower(power?: pond.DevicePower | null): PowerDescriber {
|
|||
}
|
||||
} else {
|
||||
let thresholds = notChargingThresholds;
|
||||
let suffix = "not charging";
|
||||
//Ashton tells me that with the new battery that any voltage over 2.8 is charging and it maxes out at 4.2 volts, so dropping it down here as the chip would say not charging when it really was
|
||||
if (power.inputVoltage >= 2.8) {
|
||||
thresholds = chargingThresholds;
|
||||
if (power.chargePercent === 100) {
|
||||
suffix = "charged";
|
||||
} else {
|
||||
suffix = "charging";
|
||||
}
|
||||
}
|
||||
result.description = power.chargePercent.toString() + "%, " + suffix;
|
||||
// we would not actually know if it is charging here since it is just looking at the voltage now and not comparing to previous voltage
|
||||
// let suffix = "not charging";
|
||||
// if (power.inputVoltage >= 4) {
|
||||
// thresholds = chargingThresholds;
|
||||
// if (power.chargePercent === 100) {
|
||||
// suffix = "charged";
|
||||
// } else {
|
||||
// suffix = "charging";
|
||||
// }
|
||||
// }
|
||||
// result.description = power.chargePercent.toString() + "%, " + suffix;
|
||||
// TODO: there is a plan in place to add a boolean value to power in the backend to have it check and set the boolean, we can then use that to know if it is charging or not
|
||||
result.description = power.chargePercent.toString() + "%"
|
||||
for (let i = 0; i < thresholds.length; i++) {
|
||||
if (power.chargePercent >= thresholds[i].threshold) {
|
||||
result.icon = thresholds[i].icon;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue