1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-26 15:00:13 +02:00
Commit Graph

105 Commits

Author SHA1 Message Date
José Rebelo
aacee56f39 Refactor location service 2024-04-24 23:32:48 +01:00
MrYoranimo
d39f86f3c8 Xiaomi: fix music volume command only increasing volume
Earlier Xiaomi devices would send either 0 or 100 for the requested
volume to indicate whether the app should increase or decrease the
phone's volume. Newer devices send the volume to change to, based on the
known current volume. We therefore need to check whether the device
increased or decreased the volume based on the current volume ourselves
in order to determine which event we want to fire.
2024-04-12 20:54:49 +02:00
MrYoranimo
ebf0dbc2d0 Xiaomi: remove battery-related request timer on disconnect 2024-04-07 20:25:52 +00:00
MrYoranimo
a5ff360497 Xiaomi: rework weather service 2024-04-01 21:57:12 +02:00
José Rebelo
f9917851ef Xiaomi: Fix NPE when notification lookup fails 2024-03-06 20:47:57 +00:00
MrYoranimo
53a7cc5b30 Xiaomi: run data upload service finalization on respective queue 2024-01-17 20:16:38 +00:00
MrYoranimo
b31d98c7a0 Xiaomi: add support for data uploading over SPP 2024-01-17 20:16:38 +00:00
MrYoranimo
e5c2bd51c2 Xiaomi: refactor XiaomiCharacteristic to use callback per message 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
opcode
372aa88e6e Xiaomi: Weather fixes and Implement wind and AQI
Many fields were incorrectly being sent as uint32 instead of sint32. This caused issues with forecast icons.
2024-01-09 17:28:50 +00: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
1c7289edfa Xiaomi: Fix secondary goal config 2023-12-12 21:27:50 +00:00
José Rebelo
1028d2c0cd Xiaomi: Display widget id when names are repeated 2023-12-12 20:58:42 +00:00
José Rebelo
128aed005b Xiaomi: Parse daily summary and workout gps tracks 2023-12-12 14:12:00 +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
8f2924c873 Xiaomi: Reject call with SMS reply 2023-12-10 22:12:16 +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
a3e2997f26 Xiaomi: Fix sleep mode schedule, spo2 and stress support detection 2023-12-10 12:31:19 +00:00
José Rebelo
8d1c243297 Xiaomi: Detect supported preferences 2023-12-10 12:24:59 +00:00
José Rebelo
c38d2044d8 Xiaomi: Add vitality score notification preferences 2023-12-10 11:19:01 +00:00
José Rebelo
dd0c9cf3e0 Xiaomi: Configure fitness goal notification and secondary goal 2023-12-10 11:02:22 +00:00
José Rebelo
18686e98c5 Xiaomi: Delete notification from watch when dismissed from phone 2023-12-10 10:36:14 +00:00
MrYoranimo
0378f48798 Xiaomi: fix for invalid birthdate being sent in user info 2023-12-09 00:20:22 +01: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
José Rebelo
961e9f1bf9 Xiaomi: Fix sleep schedule preference 2023-12-08 18:53:11 +00:00
José Rebelo
6984572d33 Xiaomi: Allow notification open on phone 2023-12-08 12:12:35 +00:00
José Rebelo
2b8d8c2cb0 Xiaomi: Fix dismiss multiple notifications from watch 2023-12-08 11:49:47 +00:00
José Rebelo
6479cc3bb0 Xiaomi: Allow disabling app notifications per device 2023-12-08 11:39:53 +00:00
José Rebelo
130e2ab85c Xiaomi: Fix heart rate interval and sleep support 2023-12-06 11:51:01 +00:00
José Rebelo
03dbf7533f Xiaomi: Get canned messages from watch 2023-12-06 11:18:13 +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
MrYoranimo
405596d960 Xiaomi: check for null values before encoding MusicSpec to proto 2023-12-05 20:27:33 +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
José Rebelo
95d3ff81fd Xiaomi: Fetch alarm and reminder slots from watch 2023-12-05 18:16:45 +00:00
Andreas Shimokawa
1b2a9ac140 Xiaomi: When sending contacts, use correct command to replace the ones already on the watch 2023-12-01 20:07:32 +01:00
Andreas Shimokawa
81e24e53ed Xiaomi: WIP implementation for sending contacts
This is not useful yet because contacts just get added when sending them, instaed of replacing.
Should be fixed or disabled before the release
2023-12-01 12:40:53 +01: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
MrYoranimo
b9b91db06f Xiaomi: implement phonebook service to respond to contact info requests 2023-11-30 22:54:41 +01:00
Andreas Shimokawa
6f2876fa66 Mi Watch 3 Lite: Fix firmware update
(not enabled yet)
2023-11-26 00:22:37 +01:00
José Rebelo
e91ad80d27 Xiaomi: Cleanup code and comments 2023-11-25 22:18:34 +00:00