1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-20 12:00:51 +02:00
Gadgetbridge/app/src/main/java/nodomain
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
..
freeyourgadget/gadgetbridge Xiaomi: improve battery level and charger status processing 2023-12-06 11:56:13 +01:00