1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 03:16:51 +01:00
Gadgetbridge/app
MrYoranimo b902ee96c3 Xiaomi: improve battery level and charger status processing
Because the reporting of battery state is inconsistent between different
models, the device's battery state was not correctly processed in GB.

For at least the firmware on the Xiaomi Watch S1 Active, the charger
state is broadcast through a separate message from the message
containing the battery level. Even though the battery level was
requested by GB upon receiving this broadcast, the charger state got
discarded as it was expected to also be included in the result of the
subsequent request.

This patch changes the name of the `Charger` message to `DeviceState`
and includes more fields that may be presented by some device models.
Furthemore, the broadcast is cached so that the charger state can be
processed from this cache instead of the battery level response message.
2023-12-06 11:56:13 +01:00
..
src Xiaomi: improve battery level and charger status processing 2023-12-06 11:56:13 +01:00
build.gradle Xiaomi: Cleanup code and comments 2023-11-25 22:18:34 +00:00
lint-baseline.xml Add lint baseline, enable linting on CI, fix some reported errors (#3291) 2023-09-11 09:17:04 +00:00
proguard-rules.pro Add lint baseline, enable linting on CI, fix some reported errors (#3291) 2023-09-11 09:17:04 +00:00