Commit 9925e5b
committed
fix: battery percentage showing unavailable when fully charged
When battery voltage slightly exceeds 4.2V (e.g., 4.25V when fully charged),
the previous code returned NAN, causing HA to display 'unavailable'.
Now only return NAN for truly invalid readings (voltage < 2.75V or NaN).
Voltage above 4.2V will correctly show 100% instead of unavailable.1 parent 8b12492 commit 9925e5b
File tree
1 file changed
+11
-1
lines changed- arduino/SeeedHADiscovery/examples/IoTButtonV2_DeepSleep
1 file changed
+11
-1
lines changedLines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
466 | 471 | | |
467 | 472 | | |
468 | | - | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
469 | 476 | | |
470 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
471 | 481 | | |
472 | 482 | | |
473 | 483 | | |
| |||
0 commit comments