1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-10 07:07:57 +02:00
Commit Graph

36 Commits

Author SHA1 Message Date
MrYoranimo
ebf0dbc2d0 Xiaomi: remove battery-related request timer on disconnect 2024-04-07 20:25:52 +00:00
MrYoranimo
53a7cc5b30 Xiaomi: run data upload service finalization on respective queue 2024-01-17 20:16:38 +00:00
MrYoranimo
592a52054f Xiaomi: request battery level and charging state on an interval 2024-01-17 20:16:38 +00:00
MrYoranimo
429d717630 Xiaomi: recognize a full battery as a valid charger state 2024-01-17 20:16:38 +00:00
MrYoranimo
98e8ec2329 Xiaomi: Introduce XiaomiConnectionSupport
Co-Authored-By: José Rebelo <joserebelo@outlook.com>
2024-01-17 20:16:38 +00:00
FYG_license_bot_ignore_me
4c7476845b Update license headers and CONTRIBUTORS file 2024-01-10 19:01:48 +01:00
LuK1337
0ca35ad935 Xiaomi: Handle find phone messages without system properly
After find phone is stopped, watch sends a `Command` message back
without `system` set, and because of missing hasSystem() check, we'd
wrongly go to condition that sets findPhoneEvent.event to START.
2023-12-20 19:32:17 +00:00
Andreas Shimokawa
ea0817f7b6 Use TextUtils.join intead of String.join, to make at least the linter happy
It is not clear to me if this would get desugarized anyway, but linter says needs API 26
2023-12-16 19:37:40 +01:00
José Rebelo
1028d2c0cd Xiaomi: Display widget id when names are repeated 2023-12-12 20:58:42 +00:00
José Rebelo
6de7af62e3 Xiaomi: Manage widgets 2023-12-11 22:00:16 +00:00
José Rebelo
095b9e42d3 Xiaomi: Toggle phone silent mode from band 2023-12-11 10:51:10 +00:00
José Rebelo
4051c7f7d4 Xiaomi: Add wear mode preference 2023-12-10 18:03:17 +00:00
José Rebelo
9babbf504e Xiaomi: Fix camera remote get typo 2023-12-10 13:30:14 +00:00
José Rebelo
bf9a5d90d4 Xiaomi: Add camera remote preference 2023-12-10 13:24:35 +00:00
José Rebelo
8d1c243297 Xiaomi: Detect supported preferences 2023-12-10 12:24:59 +00:00
MrYoranimo
435d41aca0 Huami/Xiaomi: centralize handling of device state events
Gadgetbridge can be configured to perform an action when a
Huami device is taken off or the user was detected to fall asleep or
wake up. This functionality was specific to Huami devices, but this
changeset moves this upstream to the AbstractDeviceSupport class in
combination with new GBDeviceEvents.

Now that the ADS has centralized support for this functionality, the
same logic can be used for other devices. In this case, an
implementation is added for supported Xiaomi devices.
2023-12-09 00:20:22 +01:00
José Rebelo
2ff92c73f8 Xiaomi: Re-enable screen on on notifications preference
- Disabled by accident on 2063bc2df
- Move preference to XiaomiNotificationService
- Get preference value on connection
2023-12-08 20:55:58 +00:00
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
José Rebelo
1c68252255 Xiaomi: Fix settings display items code 2023-12-05 18:20:02 +00:00
Andreas Shimokawa
776346d311 Xiaomi: guard against null pointer crash 2023-12-05 18:20:02 +00:00
José Rebelo
9ddbcc0c8a Xiaomi: Use display items labels from watch 2023-12-05 18:20:02 +00:00
Andreas Shimokawa
6e5bedb365 Xiaomi: Implement Screen On on Notification setting
Works on Redmi Watch 3 Active
Does not work on Mi Watch Lite
2023-12-01 07:52:08 +01:00
José Rebelo
e91ad80d27 Xiaomi: Cleanup code and comments 2023-11-25 22:18:34 +00:00
José Rebelo
29c183b88a Xiaomi: Refactor to install firmware (untested) 2023-11-25 21:16:53 +00:00
José Rebelo
b0d3fe6a51 Xiaomi: Set device language 2023-11-25 21:16:53 +00:00
José Rebelo
1acd3ac5fd Xiaomi: Remove usage of TransactionBuilders 2023-11-25 21:16:53 +00:00
José Rebelo
57c7a083aa Mi Band 8: Set display items (wip, chunked is broken) 2023-11-25 21:16:52 +00:00
José Rebelo
fcf680f799 Mi Band 8: Add find watch 2023-11-25 21:16:33 +00:00
José Rebelo
f978329711 Mi Band 8: Display items (wip, needs chunked) 2023-11-25 21:16:33 +00:00
José Rebelo
eb2a2ca742 Mi Band 8: Display items (wip) 2023-11-25 21:16:33 +00:00
José Rebelo
54e31a1521 Mi Band 8: HR, SpO2, Stress settings (untested, wip) 2023-11-25 21:16:33 +00:00
José Rebelo
8a7e6649b7 Mi Band 8: Password (untested) 2023-11-25 21:16:33 +00:00
José Rebelo
8531cfb0a1 Mi Band 8: Start handling config changes 2023-11-25 21:16:33 +00:00
José Rebelo
fd76c7b13b Mi Band 8: Find phone 2023-11-25 21:16:33 +00:00
José Rebelo
290383627e Mi Band 8: Fix system service 2023-11-25 21:16:33 +00:00
José Rebelo
fda3b53657 Mi Band 8: Initial support (WIP) 2023-11-25 21:16:31 +00:00