1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-17 02:44:04 +02:00
Commit Graph

2934 Commits

Author SHA1 Message Date
foxstidious
ba59c62fa4 Add support for snooze alarm on CasioGBX100 devices 2024-01-14 20:29:30 +00:00
opcode
f5cf21bf05 Xiaomi: Parse SleepSummary 2024-01-14 17:02:42 +00:00
opcode
e06b2e1f95 Xiaomi: Implement sleep stage parsing
This allows sleep stage detection to work by parsing
some of the data sent in SleepDetails.

It's still missing parsing the summary contained inside SleepDetails.
and decoding the large amount of other mostly unknown data.
2024-01-14 17:02:42 +00:00
José Rebelo
823bd829ce Zepp OS: Add some missing control center items 2024-01-10 19:47:25 +00:00
Martin.JM
704875c3c2 Update license headers 2024-01-10 18:25:20 +00:00
FYG_license_bot_ignore_me
4c7476845b Update license headers and CONTRIBUTORS file 2024-01-10 19:01:48 +01:00
José Rebelo
d63db41f90 Huami: Display proper error when battery too low to install firmware 2024-01-09 19:12:03 +00:00
José Rebelo
aeec68aeef Huami: Fetch SpO2 on devices that support it 2024-01-09 17:43:43 +00: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
Davis Mosenkovs
5bcebe9590 Disconnect all devices that are not NOT_CONNECTED
Disconnect devices in all states except GBDevice.State.NOT_CONNECTED.
This should fix devices getting stuck in GBDevice.State.CONNECTING state
when Bluetooth is switched off.
2024-01-08 17:11:33 +00:00
Davis Mosenkovs
9e10da062e Add "Reconnect only to connected devices" setting
* Add general_reconnectonlytoconnected setting.

* Replace last_device_address shared prefs string with
last_device_addresses shared prefs string set.
Bluetooth address of a device is added to last_device_addresses when
connecting to the device.
Bluetooth address of a device is removed from last_device_addresses only
when deleting the device or explicitly disconnecting from the device
(e.g. by selecting "Disconnect" in the device tile menu).

* Adjust ExternalPebbleJSActivity to better support multiple connected
devices.
2024-01-08 17:11:33 +00:00
Davis Mosenkovs
904a7807a8 Automatically connect to all devices
Automatically connect to all devices instead of connecting only to the
last connected device.
2024-01-08 17:11:33 +00:00
Damien 'Psolyca' Gaignon
0c22ecdd51
Huawei: Add initial support for Huawei-Honor 2024-01-07 23:18:08 +01:00
José Rebelo
ab894ae433 Extract hardcoded activity summary entries to constants 2024-01-06 13:54:06 +00:00
José Rebelo
4e54f8137d Xiaomi: Improve walking v2 parsing 2024-01-05 21:29:12 +00:00
José Rebelo
a61f7d70d5 Xiaomi: Parse indoor cycling 2024-01-05 21:25:17 +00:00
José Rebelo
dd1843505e Xiaomi: Fix extreme hr zone parsing 2024-01-05 21:07:22 +00:00
José Rebelo
f7258034cc Xiaomi: Refactor workout summary parsing 2024-01-05 21:04:19 +00:00
José Rebelo
05d8f99312 Nothing Ear (Stick): Initial support
- Refactor common coordinator logic to AbstractEarCoordinator
- Increment message counter on the stick
- Make audio modes translatable
2024-01-05 09:35:03 +00:00
FintasticMan
ecd13b4d8e Update to new simple weather spec 2024-01-04 20:34:21 +00:00
FintasticMan
655d202512 Add simple weather condition
Co-authored-by: Victor Kareh <vkareh@redhat.com>
2024-01-04 20:34:21 +00:00
FintasticMan
127867441a Add support for InfiniTime's new simple weather
Co-authored-by: Jean-François Milants <jf@codingfield.com>
2024-01-04 20:34:21 +00:00
José Rebelo
932ec8336c Xiaomi: Fix persisting unknown workouts 2024-01-03 21:37:27 +00:00
José Rebelo
951d8f25b7 Xiaomi: Add indoor cycling 2024-01-03 21:35:18 +00:00
Jean-François Milants
73a3a4b603 Fix DFU MTU value for PineTime
Explicitely disable the request MTU feature from the NRF DFU library to ensure that it'll send 20 bytes packets (instead of 253B, which will crash InfiniTime).
2024-01-03 20:42:22 +00:00
José Rebelo
70e1d852ba Xiaomi: Fix crash when parsing unknown workout summary 2023-12-30 18:37:22 +00:00
José Rebelo
1907912bd2 Xiaomi: Fix outdoor walking parsing on some watches 2023-12-29 19:54:43 +00:00
José Rebelo
c9fec4e33a Xiaomi: Identify strength training, elliptical and outdoor running 2023-12-26 22:07:35 +00:00
José Rebelo
aa7c2b1731 Xiaomi: Improve workout summary parsing
Outdoor walking on the Mi Band 8, but does not seem to match the summary
from the Mi Band 7 Pro.
2023-12-26 22:02:43 +00:00
Andreas Shimokawa
177fa56bb9 Pixoo: Quick hack to "install" any image on the pixoo 2023-12-26 20:38:13 +01:00
Andreas Shimokawa
f4d7a6b490 Pixoo: implement sending bitmaps
Not really used right not - mapped to "test new functionality"
2023-12-26 01:14:16 +01:00
José Rebelo
09fbc2665b Redmi Watch 2 Lite: Experimental support 2023-12-24 16:38:11 +00:00
José Rebelo
1cfd00c924 Pixoo: Add setting to disable notifications 2023-12-23 21:51:54 +00:00
José Rebelo
4a7a201971 Pixoo: Support custom device name 2023-12-23 21:27:57 +00:00
Arjan Schrijver
7aeb0dd2ef Fossil/Skagen Hybrids: Update navigationApp to 1.1
Changes:
- Support locking (keep visible and let hands display time)
- Support merge navigation instruction
- Support wrist flick gesture to move hands
- Support GB-configurable foreground and vibration behaviour
2023-12-23 22:05:51 +01:00
José Rebelo
a62ff4eabb Xiaomi: Improve activity details parsing on some devices 2023-12-22 22:44:30 +00:00
José Rebelo
b79f774e3e Xiaomi: Add debug function to parse all activity files from storage 2023-12-22 22:21:51 +00:00
José Rebelo
09c33b3541 Xiaomi: Persist and overlay sleep stages 2023-12-22 22:21:51 +00:00
José Rebelo
82863ff305 Xiaomi: Add sleep stages parser
From Alice
2023-12-22 19:19:56 +00:00
José Rebelo
b535784117 Mijia LYWSD03MMC: Initial support
Same protocol as LYWSD02, but does not support setting the time.
2023-12-22 12:35:35 +00:00
José Rebelo
149b6236a0 Mijia LYWSD: Make support class generic 2023-12-22 12:26:15 +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
81c9aa5faf Pixoo: support "clap hands to turn off screen" and "sleep after silence" settings
Also fix crc calculation :P
2023-12-19 21:08:25 +01:00
Andreas Shimokawa
198800e087 Pixoo: Decode alarms from device, support sending alarms
This is probably not quite right yet.

Also we need to properly chunk incoming protocol messages before decoding them
2023-12-19 10:58:49 +01: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
bddec00de1 Xiaomi: Persist daily summary 2023-12-12 20:26:55 +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
108307c711 Redmi Smart Band 2: Experimental support
Characteristics taken from #3274
2023-12-11 13:58:00 +00:00
José Rebelo
095b9e42d3 Xiaomi: Toggle phone silent mode from band 2023-12-11 10:51:10 +00:00
José Rebelo
efc8752a66 Zepp OS: Toggle phone silent mode from band 2023-12-11 10:50:50 +00:00
José Rebelo
4dbf9bb8ac Huami: Toggle phone silent mode from band 2023-12-11 10:50:31 +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
José Rebelo
ef73ea1bd5 Make LimitedQueue generic 2023-12-10 10:30:27 +00:00
José Rebelo
4d12ac93e7 Allow multiple device actions to be triggered for the same event 2023-12-09 11:40:28 +00:00
José Rebelo
25196a932e Allow toggling DND through device actions 2023-12-09 11:01:55 +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
f29995b571 Zepp OS: Allow disabling app notifications per device 2023-12-08 11:29:20 +00:00
Andreas Shimokawa
b4aca410b4 Pixoo: implement some protocol for testing 2023-12-07 21:07:52 +01:00
Andreas Shimokawa
b44b0fec7e Divoom Pixoo: Initial experimental support
Works:
- notifications
- call notification
- set time
- setting brightness
- setting 24h/12h format
- sending weather

Note
- this is implemented using using the classic bluetooth serial protocol, the
  device can do BLE, but I don't know how to use it, as I did not have the
  offical app to sniff.
- The information about the protocol comes from here
  https://github.com/jfroehlich/node-p1x3lramen/blob/main/source/devices/pixoo.js

TODO:
- Enable beep? Possible? I heard it beep once at least when switching it on
- Getting out of factory mode? Why does it always play animations even when I
   switch to the clock?
- Implement switching modes (can be done with the button)
- Implement sending own images and animations
- Firmware update?
- ...
2023-12-06 15:56:18 +01: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
MrYoranimo
561dc16b28 DeviceCommunicationService: catch uncaught exceptions from handleActions
Exceptions raised while handling actions in the device's support class
may result in the DeviceCommunicationService crashing as a whole and not
being started again until the user forces GB to make a connection by
pressing the device from the list.

This change is made, because Xiaomi devices make use of proto2 messages,
where optional fields cannot be set to null values as that will make it
throw NPEs.
2023-12-05 20:19:12 +01:00
José Rebelo
7f7834c620 Xiaomi: Fix reconnect if characteristics are null
If a service was found, but characteristics are null, maybe we're just
connecting too early - set the device to reconnect.
2023-12-05 18:30:33 +00:00
José Rebelo
4de7cb3591 Xiaomi: Improve service auto-detection
Some watches have the encrypted service, even though they're plaintext,
but are missing the characteristics.
2023-12-05 18:28:39 +00: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
3ab1ac26db Refactor known preference values code to be reusable 2023-12-05 18:20:02 +00:00
José Rebelo
2dacdcface Xiaomi: Log service 2023-12-05 18:17:50 +00:00
José Rebelo
95d3ff81fd Xiaomi: Fetch alarm and reminder slots from watch 2023-12-05 18:16:45 +00:00
MrYoranimo
5f9fda4f07 BtLEQueue: fix typo in onCharacteristicChange 2023-12-04 23:32:23 +01:00
MrYoranimo
b303da4e62 Xiaomi: wrap parsing of activity data in try block
This will prevent uncaught exceptions that occur during the
parsing of activity data from breaking up the activity fetching
chain and causing the task to never get completed.
2023-12-04 23:32:18 +01:00
MrYoranimo
0f83346d65 Xiaomi: check if binary parser result is null
The activity parser may return null pointers in case the version
of the data structure is not supported. Not checking for null here may
result in the activity fetching task may never complete and cause
further communication with the device to grind to a halt.
2023-12-04 22:03:59 +01:00
José Rebelo
376956bbe9 Xiaomi: Improve activity fetch logging 2023-12-04 09:46:49 +00:00
José Rebelo
ec050d7a4f Xiaomi: Unify encrypted and plaintext logic 2023-12-02 11:25:32 +00:00
José Rebelo
ba0ca1de75 Delegate auth key validation to coordinator 2023-12-02 10:59:34 +00:00
José Rebelo
84692e5432 Mi Band 8: Persist bedtime and wakeup times to database 2023-12-01 21:35:29 +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
Gordon Williams
684d976bfc Bangle.js: Ensure SMS messages have src field set to "SMS Message" (it was previously left out) 2023-11-30 09:33:07 +00:00
Gordon Williams
8ef80a2565 Bangle.js: ensure GPS speed is reported correctly when the phone is providing it 2023-11-29 10:04:33 +00:00
José Rebelo
ae75f82a63 Zepp OS: Improve activity fetch logging 2023-11-26 21:14:46 +00:00
Andreas Shimokawa
6f2876fa66 Mi Watch 3 Lite: Fix firmware update
(not enabled yet)
2023-11-26 00:22:37 +01:00
foxstidious
deeaf28de4 Limit characters in heading and subheading to 32 (or else casio won't display the notification) 2023-11-25 22:52:26 +00:00
foxstidious
40af20a176 Removed call to start intent if no companion, defaulted companion preference to true, and reordered casio alert preferences to match watch order. 2023-11-25 22:52:26 +00:00
foxstidious
264ab14847 Fixed alert logic 2023-11-25 22:52:26 +00:00
foxstidious
4dc10d1d02 Implemented better message preview, added ability to specify high-level alert by category 2023-11-25 22:52:26 +00:00
foxstidious
11bf0acf32 Changed notification timestamp format to be implemented specifically for GBD-200 2023-11-25 22:52:26 +00:00
foxstidious
6be7f7c9cc Fixed find phone on, added preference to preview messages on Casio GDB-200 2023-11-25 22:52:26 +00:00
foxstidious
a1b59774d4 Fixed notification time stamp on Casio GDB-200 2023-11-25 22:52:26 +00:00
foxstidious
d9d6a8dc29 Categorized Google Voice messages as GENERIC_SMS, cleaned up some Casio support code, added portion of message text to notification title 2023-11-25 22:52:26 +00:00
Andreas Böhler
6ef6c9be43 Fix Bonding for the Casio GB5600/6900/STB-1000 series 2023-11-25 22:46:45 +00:00
José Rebelo
e91ad80d27 Xiaomi: Cleanup code and comments 2023-11-25 22:18:34 +00:00
José Rebelo
543c8b28d0 Rename org.bouncycastle package
Fixes roboelectric in unit tests.
2023-11-25 21:16:53 +00:00
José Rebelo
0dcb316461 Mi Band 8: Basic workout summary parser (wip) 2023-11-25 21:16:53 +00:00
José Rebelo
fa20bf66c6 Mi Band 8: Fix send gps location during workout 2023-11-25 21:16:53 +00:00
José Rebelo
dad97f9e96 Xiaomi: Update weather AQI and warning proto 2023-11-25 21:16:53 +00:00
José Rebelo
516b3dbf1e Mi Band 8: Fix notification icons for long package names 2023-11-25 21:16:53 +00:00
José Rebelo
8192106fc0 Mi Band 8: Fix notification icons mirroring 2023-11-25 21:16:53 +00:00
José Rebelo
3948f95505 Xiaomi: Dismiss notification from phone when dismiss from watch 2023-11-25 21:16:53 +00:00
José Rebelo
ff2a26756f Mi Band 8: Fix weather (set current location) 2023-11-25 21:16:53 +00:00
Andreas Shimokawa
50f086b03a Xiaomi: Implement daily forecast
Works on Mi Watch Lite
2023-11-25 21:16:53 +00:00
Andreas Shimokawa
e2f60b38c9 Xiaomi: fix NPE when no air quality is available 2023-11-25 21:16:53 +00:00
Andreas Shimokawa
0e3e406320 Xiaomi: Send AQI
Todo: map to strings
2023-11-25 21:16:53 +00:00
José Rebelo
047cc71d28 Mi Band 8: Upload custom notification icons 2023-11-25 21:16:53 +00:00
Andreas Shimokawa
9749716c23 Xiaomi: add two more fields to current weather (seen on Mi Band 8) 2023-11-25 21:16:53 +00:00
Andreas Shimokawa
929ea7ae57 Xiaomi: Implement sending current weather
TODO: Support °F, find out about unknown values

Tested on Mi Watch Lite
2023-11-25 21:16:53 +00:00
José Rebelo
cab63b2c98 Mi Band 8: Fix watchface upload 2023-11-25 21:16:53 +00:00
Andreas Shimokawa
27fba50283 Xiaomi: move emoji conversion to base class
This works on Mi Watch Lite from FW 4.1.12
2023-11-25 21:16:53 +00:00
José Rebelo
29c183b88a Xiaomi: Refactor to install firmware (untested) 2023-11-25 21:16:53 +00:00
José Rebelo
c47e830056 Xiaomi: Watchface upload (wip, does not work) 2023-11-25 21:16:53 +00:00
José Rebelo
82a264cd65 Xiaomi: Improve emoji mapping efficiency 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
48e149aefe Xiaomi: Refactor XiaomiCharacteristic to improve logging and ordering
Fixes a potential race condition on initialization, since the chunked
commands were being scheduled on a separate transaction builder, which
would be scheduled to be written before the initialization.
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
e2d7798e36 Xiaomi: Refuse delete of active watchface 2023-11-25 21:16:53 +00:00
José Rebelo
a895a6aae7 Xiaomi: Set and delete watchfaces 2023-11-25 21:16:53 +00:00
José Rebelo
7fb81b6e0d Xiaomi: Fix edge cases in chunked math 2023-11-25 21:16:53 +00:00
José Rebelo
fa72820e5a Mi Band 8: Map emoji (inefficient) 2023-11-25 21:16:53 +00:00
José Rebelo
81ca617601 Xiaomi: Prevent NPE when not yet connected 2023-11-25 21:16:53 +00:00
José Rebelo
ce1d095074 Xiaomi: Add encrypted and plaintext coordinators 2023-11-25 21:16:53 +00:00
José Rebelo
4e680cfcce Mi Band 8: List watchface in app management 2023-11-25 21:16:53 +00:00
Andreas Shimokawa
9ea7b48e0c Xiaomi: Add outdoor running subtype to enum. 2023-11-25 21:16:53 +00:00
Andreas Shimokawa
7a3139fce0 Xiaomi: remove call notification if call has been taken on the phone or rejected, ended.
For in-call notification if those exist, it would not work.
2023-11-25 21:16:53 +00:00
José Rebelo
acba91d3c5 Xiaomi: Refactor daily parser slightly 2023-11-25 21:16:53 +00:00
José Rebelo
d3eb69fcf7 Mi Band 8: Send gps to watch (wip) 2023-11-25 21:16:53 +00:00
José Rebelo
0c27772bb5 Xiaomi: Map elliptical workout 2023-11-25 21:16:52 +00:00
Andreas Shimokawa
fce2dfa0ca Xiaomi: fix incoming calls on Mi Watch lite (shoud not break Mi Band 8) 2023-11-25 21:16:52 +00:00
Andreas Shimokawa
9e1a6ca76a Xiaomi: change order of enabling notifications 2023-11-25 21:16:52 +00:00