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:
csawatzky 2025-09-29 14:50:51 -06:00
parent 612a8da0f7
commit 8dad7ae38b

View file

@ -71,17 +71,19 @@ export function describePower(power?: pond.DevicePower | null): PowerDescriber {
} }
} else { } else {
let thresholds = notChargingThresholds; let thresholds = notChargingThresholds;
let suffix = "not charging"; // 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
//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 // let suffix = "not charging";
if (power.inputVoltage >= 2.8) { // if (power.inputVoltage >= 4) {
thresholds = chargingThresholds; // thresholds = chargingThresholds;
if (power.chargePercent === 100) { // if (power.chargePercent === 100) {
suffix = "charged"; // suffix = "charged";
} else { // } else {
suffix = "charging"; // suffix = "charging";
} // }
} // }
result.description = power.chargePercent.toString() + "%, " + suffix; // 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++) { for (let i = 0; i < thresholds.length; i++) {
if (power.chargePercent >= thresholds[i].threshold) { if (power.chargePercent >= thresholds[i].threshold) {
result.icon = thresholds[i].icon; result.icon = thresholds[i].icon;