1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-01-02 14:06:00 +01:00
Commit Graph

255 Commits

Author SHA1 Message Date
José Rebelo
3e327e2924 Workout Details: Add tables and progress bars 2024-10-01 20:27:59 +00:00
José Rebelo
5192304d29 RuntimeTypeAdapterFactory: Allow null labels 2024-10-01 20:27:59 +00:00
José Rebelo
d4a451e8c8 CalendarReceiver: Convert to ContentObserver 2024-09-29 11:14:23 +00:00
Marcel
d182fe58e8 Add support for Sony WF-C700N 2024-09-28 22:12:49 +00:00
José Rebelo
5730e82380 Bangle.js: Refactor activity details 2024-09-28 22:03:26 +00:00
José Rebelo
f5ad01f2fe Update mockito to 5.14.0, fix tests 2024-09-28 13:20:07 +01:00
José Rebelo
49750e31af Fix gpx hr parsing and unit tests 2024-09-23 22:13:01 +01:00
Zahnstocher
fd06519cd1 rename BatteryDual_2 to BatteryDual_NoCase and DUAL_2 to DUAL_NO_CASE 2024-09-17 22:35:47 +02:00
Zahnstocher
57c8c77305 Add support for Sony WF-C500 2024-09-17 11:37:39 +02:00
José Rebelo
9fcd463bfc Fix import of some hashset preference values from xml 2024-09-11 22:28:56 +00:00
Me7c7
1f5e9b52b8 Huawei: Quick fix issue with concatenated packets. 2024-09-06 20:12:56 +00:00
Daniele Gobbetti
fd1e81ff66 Garmin: fix basetype handling and truncation
Numeric BaseTypes now return fractional part if a scale is set, the return type for numeric values is unboxed from Number class so that existing comparisons and checks keep working, but values are not truncated at nearest integer value.

The codegen class has been updated and some of the messages are re-generated with the new code, with the exception of Hrv* messages, since updating those needs updating the related sample types.

Test cases expected values have been adjusted to keep into account the fractional part of some fields.

Garmin: Fix HRV value and summary types
2024-08-18 22:15:06 +02:00
José Rebelo
94fae05b02 Mark getActivitySamples as deprecated and disable tests
Test regression introduced by the refactor in 34378a4a1

The function is not used a lot, and it's currently misleading alongside
getAllActivitySamples, so it could eventually be removed and the logic
simplified.
2024-08-17 19:56:17 +01:00
Daniele Gobbetti
29787d0c9b Garmin: add gpx import functionality for models that support it
Add a Field definition for GPS coordinates and remove the corresponding method from GarminUtils.
Add a new message COURSE and some fields to other known messages.

Also centralize some utility methods in GpxParser and GpxTrack, adapting ZeppOsGpxRouteFile.

Be aware that the capability used to identify the supported watches might be the wrong one.
2024-08-16 18:52:13 +02:00
José Rebelo
34378a4a11 Refactor ActivityKind into an enum 2024-08-14 23:13:12 +01:00
José Rebelo
97879ac9fc Garmin: Fix tests
Regression introduced by the enum rename from b33ab0b1c
2024-08-03 10:07:20 +01:00
Martin.JM
6f83fc815f Huawei: Simple TruSleep support
Only supports start and end time of sleep periods.
2024-07-30 22:34:05 +02:00
Martin.JM
16b293fdb1 Huawei: MusicControl test updated
* tests for 4-byte button and volume values
2024-07-27 11:48:33 +00:00
Martin.JM
b8a2fc0076 Huawei: fix race condition in BtBR
Should be a fix for #3914.
2024-07-22 20:27:06 +02:00
José Rebelo
c376034409 Enable core library desugaring 2024-07-04 20:20:00 +01:00
José Rebelo
5c5b036e20 Update android-emojify to 1.9.2
- Ignore the moshi R8 errors, since we use gson
- Add explicit rtl support, otherwise the lib removes it
- Refactor EmojiConverter to exclude fitzpatrick
2024-07-04 19:58:03 +01:00
José Rebelo
7c665f997b Update mockito to 5.12.0 2024-07-03 18:51:46 +01:00
Martin.JM
1f1fc33e43 Huawei: Fix BR partial packets
Would crash before. See added test for example.
2024-06-20 22:02:36 +00:00
Martin.JM
72dcb3250e Hauwei: Extend debug request to allow setting the sliced flag 2024-06-18 20:45:38 +00:00
José Rebelo
0e9c709a59 Xiaomi: Ignore activity files without timestamp and version
Some watches will send a sequence of zeroes, which would make activity
fetch become stuck, as the file does not exist.
2024-06-02 21:48:41 +01:00
José Rebelo
f3cc07af27 Garmin: Fix COBS encoding of long non-zero sections 2024-05-24 22:24:09 +02:00
Daniele Gobbetti
c3a6db3309 Garmin: adjust test after adding distance field 2024-05-24 22:24:09 +02:00
José Rebelo
553f6171e6 Garmin: Map all supported workout types 2024-05-24 22:24:09 +02:00
José Rebelo
0b07f36817 Garmin: Persist and display activity
- Steps, hr, intensity
- Sleep stages
- Stress
- SpO2
- Workouts
2024-05-24 22:24:08 +02:00
José Rebelo
92b838f90c Garmin: Fix logging during tests 2024-05-24 22:24:08 +02:00
José Rebelo
1b45d71cc7 Garmin: Improve fit parsing
* Remove the dependency on PredefinedLocalMessage from generic fit parsing code
* Standardize toString methods, omit types for known fields
* Return null on unknown field number or names, instead of crashing
* Map more Global FIT messages (device info, monitoring, sleep stages, sleep stats, stress level)
* Prioritize "timestamp" over "253_timestamp" if specified explicitly in the global message definition
* Introduce RecordData wrappers for each global message, allowing us to have proper types when getting data. If missing or unknown, the getter returns null. All classes are auto-generated by the FitCodeGen.
* Persist a list of RecordData, instead of a Map from RecordDefinition
* Fix parsing of compressed timestamps - keep them in computedTimestamp on each data record
* Use timestamp16 if available in Monitoring records
2024-05-24 22:24:08 +02:00
Daniele Gobbetti
01d48cde91 Garmin: Rename LocalMessage to PredefinedLocalMessage and clarify its usage
PredefinedLocalMessage are only useful for FIT messages and should not interfere with FIT files. The only impact of using the local message in fit files was in the textual output, but it was confusing.

Add an explicit constructor to RecordHeader if PredefinedLocalMessage should be taken into account, and use this only in fit messages leaving the default constructor for fit files.

Also adjusts the test case as textual output comparison needs to be fixed.
2024-05-24 22:24:08 +02:00
Daniele Gobbetti
42e44de1ac Garmin: Support file archival (deletion) on watch
Also add original timestamp to local cache filename as the file identifier are reused
Also fix imports of Test class
2024-05-24 22:24:07 +02:00
Daniele Gobbetti
6cb5184e2b Garmin protocol: various changes
- add FitFile class that deals with parsing and generating outgoing files
- consider all field definitions with number 253 as Timestamps [0]
- add support for "compressed timestamps" in fit file parsing. Those are not returned among the other normal fields but are available through a method of RecordData
- adjust the test cases

[0]48b6554d8a/fitdecode/reader.py (L719)
2024-05-24 22:24:07 +02:00
Daniele Gobbetti
e814a63590 Garmin protocol: change naming and logic of several FIT classes
- refactor the logic of Global and Local messages
- add some Global messages with naming taken from [1]
- Global messages are not enum because there are too many
- introduce the concept of FieldDefinitionPrimitive
- add new Field Definitions
- add support for developer fields and array fields
- add test case for FIT files taken from [0]

[0] https://github.com/polyvertex/fitdecode/
[1] https://www.fitfileviewer.com/
2024-05-24 22:24:07 +02:00
Daniele Gobbetti
c8c51064c3 Garmin protocol: refactoring and fixes of BaseTypes
The boundaries are enforced on the stored value when decoding, before applying the adjustments for scale and offset.
Also add some tests for the BaseTypes
Introduce new FieldDefinition for Temperature and WeatherCondition (removing the static class)
Add accessors for field data in the containing RecordData, thus keeping the FieldData private
2024-05-24 22:24:07 +02:00
Daniele Gobbetti
559a73cc5e Garmin protocol: initial refactoring and basic functionalities
This commit takes aims to bring many new garmin devices up to a working status, with basic functionalities such as:
- garmin protocol initialization
- basic message exchange
- support for some messages in Garmin own format
- support for some messages in protobuf format
2024-05-24 22:24:07 +02:00
Alik Aslanyan
dc1ffdafcd Rework Armenian transliteration to handle more edge cases around mixed letters 2024-05-04 20:45:35 +04:00
Martin.JM
83fd09939f [Huawei] Fix PR #3742, add workout frequency and altitude 2024-05-01 16:32:27 +00:00
José Rebelo
18e08d13da Fix tests and linter 2024-04-30 20:43:23 +01:00
José Rebelo
61af26d7ce Add Serbian transliterator
As discussed in #3727
2024-04-25 17:51:45 +01:00
Daniele Gobbetti
173e2d29b0 Include Organizer and Reminders when reading calendar events
Also use the named column indexes instead of numeric ids when retrieving the contents to make it more clear and more robust in case further fields are added later.

Reminders are set as absolute timestamp.
2024-04-25 11:46:34 +02:00
Alik Aslanyan
f0a9ab7f98 Add Armenian transliteration 2024-04-15 19:58:27 +04:00
Damien 'Psolyca' Gaignon
a29187a034
[Huawei] Fix long notification and clean Notifications class 2024-04-03 23:05:53 +02:00
José Rebelo
0301d0e9a8 Sony Headphones: Merge V3 protocol into V2
The protocols are not actually different - the different messages only
depended on whether the devices supports wind noise reduction or not.
2024-03-15 22:56:11 +00:00
Daniel Dakhno
afe3c1fd50 Testing: fixed unit tests 2024-03-05 00:11:32 +01:00
Andreas Shimokawa
8b9462f521 fix tests 2024-02-12 18:31:48 +01:00
Damien 'Psolyca' Gaignon
ef06fd4d5e
[Huawei] Fix test 2024-02-09 12:03:03 +01:00
Damien 'Psolyca' Gaignon
270212a771
[Huawei] Rename authMode to deviceSupportType 2024-02-09 12:03:01 +01:00
José Rebelo
34fd18885a Zepp OS: Refactor firmware uploads
Zepp OS 3 firmware upgrades are big (200MB+). Gadgetbridge was crashing,
since the entire firmware file would be pulled into memory.

This commit unifies all the logic for Zepp OS firmware handling.

However, since the needed refactor was big, this commit duplicates some
of the code from Huami classes, namely:
- ZeppOsFirmwareUpdateOperation clones UpdateFirmwareOperation2020
- ZeppOsFwInstallHandler clones AbstractMiBandFWInstallHandler

This avoids changes to older device logic and introducing regressions.

Lost functionality:
- Repackaging firmwares as UIHH (does not seem to be needed, and was not
  used anyway). Code can be recovered from this commit if needed in the
  future
- Whitelisted firmwares by checksum (we do not have a lot of them at
  this point anyway)

Other misc changes:
- Rename ZipFile to GBZipFile not to clash with the java class

Tested by updating the Amazfit GTR 4 to Zepp OS 3.
2024-02-01 18:47:28 +00:00