fix battery_level#937
Conversation
|
The latest Buf updates on your PR. Results from workflow pull-request / build (pull_request).
|
|
@jamesarich @garthvh I like this strategy. It would be a good one to run through the cross platform design? |
|
Yes let's. Also in the same vein I've noticed that the BLE BAS battery reporting isn't working appropriately and could possibly benefit from this as well. |
|
I think this is nice. How do these get populated in meshtastic? If the info is reported from charger ICs, I would suggest reporting battery presence and charging state if we have the info too, separate from the last status proposed. In many chargers, we can get the following info:
So maybe the list could be longer? Maybe this would unload a bit the |
It may not be possible to get the detailed info but could be assumed if percentage is at 100% and not charging then the battery may be full. |
That sounds good.
Maybe best to not assume failure then, if we can't know for sure. |
My point is that in your list there is no other option than failure (or full) if it's not charging, so I opted for a more neutral NOT_CHARGING rather than having to set it to CHARGE_FAILURE. E.g. the charger could be manually turned off, or the device does not support charging like the T-Beam 1W. |
Oh, but the battery could be Will you keep the list as the original then, or consider adding other suggested options? |
What about: |
Looks great to me! ❤️ I can support on the firmware side if needed. |
This PR fixes the
battery_levelfield which has been hijacked by a powered state (battery_level> 100).While powered to USB / charging the battery the UI has no percentage information about the battery level except when re-implementing the battery curves (i.e. deduct from actual voltage) which are already implemented in the firmware. For a user this is a poor experience as he doesn't see the actual percentage level of his device to know when it's fully charged, but many devices already provide this detail of information.
This PR removes this semantic from
battery_levelby defining a clean newbattery_statusfield that provides distinct charging information and helps to preserve the percentage information during charging.Checklist before merging