1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-09-03 13:23:24 +02:00
Commit Graph

2066 Commits

Author SHA1 Message Date
oliexdev
9e467410ac Convert BLE measurement values to user-defined units before saving
This change ensures that raw values received from Bluetooth scales (e.g., weight in KG, body fat in %) are converted to the units specified by the user in the MeasurementType settings before being persisted to the database.
2025-09-02 19:35:25 +02:00
oliexdev
b6df901c50 Ensure scale detection based on real Bluetooth device names 2025-09-02 18:49:34 +02:00
oliexdev
b075d8c00c Introduce unified TuningProfile for all link types enum (Balanced, Conservative, Aggressive) and corresponding data classes (BleGattTuning, BleBroadcastTuning, BtSppTuning) to manage link-specific timing and retry parameters. 2025-09-02 17:51:36 +02:00
oliexdev
303d74edbe Improved GATT scale connection reliability and error reporting 2025-09-02 16:49:10 +02:00
oliexdev
1bd1c3632a Prioritize passed-in user for BT connect, allow brief wait for app state 2025-09-02 16:24:48 +02:00
oliexdev
993cb178a5 Refactor: Modernize multiple Bluetooth scale handlers:
- AAAxHandler (broadcast-only)
- ActiveEraBF06Handler
- BeurerSanitasHandler (BF700/800, SBF70/75, Crane)
- CustomOpenScaleHandler (HM-10 based)
- DebugGattHandler (for inspection, replaces BluetoothDebug)
- DigooDGSO38HHandler (Mengii)
- ExcelvanCF36xHandler
- ExingtechY1Handler (VScale)
- HesleyHandler (YunChen)
- HoffenBbs8107Handler
- HuaweiAH100Handler
- IHealthHS3Handler (Classic SPP)
- RenphoES26BBHandler
- StandardBeurerSanitasHandler (unifies SBF72, BF105/950/500/600)
2025-09-02 12:38:30 +02:00
oliexdev
b40a3bbf5d Separate ModernScaleAdapter into link-specific adapters:
- `ModernScaleAdapter` (abstract base): Handles app integration, event streams, and handler wiring.
- `GattScaleAdapter`: Implements BLE GATT connections using Blessed.
- `BroadcastScaleAdapter`: Handles devices that only use BLE advertisements.
- `SppScaleAdapter`: Implements Bluetooth Classic SPP connections.
2025-09-02 10:57:45 +02:00
oliexdev
15566aa1e3 This commit adds seven new modern Bluetooth scale handlers:
- **1byone (classic):** Service 0xFFF0, notify 0xFFF4, write 0xFFF1. Includes mode/unit, clock sync, history, and real-time measurements with body composition via OneByoneLib.
- **1byone (new):** Service 0xFFB0, notify 0xFFB2, write 0xFFB1. Parses 0x80 (final weight), 0x01 (impedance), and 0x00 (history/real-time) frames. Includes weight request, user history upload, and body composition via OneByoneNewLib.
- **Inlife:** Service 0xFFF0, notify 0xFFF1, write 0xFFF2. Handles user sync, live weight, and two result frame variants (legacy derived values and new weight+impedance).
- **Medisana BS44x:** Service 0x78B2. Parses weight (0x8A21) and feature (0x8A22) frames, with time sync (0x8A81). Includes auto-detection for UNIX vs. 2010 timestamp epoch.
- **MGB (SWAN / Icomon / YG):** Service 0xFFB0, notify 0xFFB2, write 0xFFB1. Implements config sequence (user, time, unit) and parses two-part data frames for weight and body composition.
- **Mi Scale (v1/v2):** Handles v1 (history, time sync) and v2 (live frames with impedance, history, time sync, unit config). Uses MiScaleLib for body composition.
- **OKOK (broadcast):** Unified handler for V20, V11, VF0, and "Nameless" (0xC0 low byte) variants via manufacturer data in advertisements. Parses weight and (for V20) impedance.
2025-09-02 10:07:49 +02:00
oliexdev
8524082c98 Adds modern Kotlin-based handlers for several Bluetooth scale models:
- **ES-CS20M:** Handles Yunmai-like scales using vendor service 0x1A10.
- **QN / FITINDEX ES-26M:** Supports scales using vendor protocol on 0xFFE0/0xFFF0.
- **RENPHO ES-WBE28:** Implements support for GATT-based Renpho scales.
- **Sanitas SBF72/BF915/SBF73:** Extends StandardWeightProfileHandler with vendor specifics.
- **Senssun:** Supports Senssun body composition scales with two GATT layouts.
- **Sinocare:** Broadcast-only handler for Sinocare "Weight Scale" devices.
- **Soehnle:** Handles Soehnle smart scales using custom and standard services.
2025-09-01 20:17:30 +02:00
oliexdev
81783bae0b This commit refactors the connection logic in ModernScaleAdapter.kt to improve handling of broadcast-only Bluetooth devices. 2025-09-01 18:27:08 +02:00
oliexdev
d4ecb37d11 Introduce LinkMode and broadcast-only support for ModernScaleAdapter, allowing handlers to declare whether they communicate via GATT or by parsing advertisement data only. 2025-09-01 18:18:17 +02:00
oliexdev
b0c7f44854 Refactor: Introduce modern BLE scale handlers and adapter, which introduces a new architecture for handling Bluetooth Low Energy (BLE) scales, moving away from the legacy Java-based system towards a more modern, Kotlin-based approach. 2025-09-01 17:30:03 +02:00
oliexdev
baaae69c66 Convert legacy Bluetooth scale algorithm classes to Kotlin and unit tests have been added for each of these Kotlin classes to verify the correctness of the ported algorithms against snapshot values and behavioral properties. 2025-08-30 15:22:49 +02:00
oliexdev
84161c8089 Rename .java to .kt 2025-08-30 15:22:49 +02:00
oliexdev
bdd20422ce Add MeasurementType User and dialog to change user 2025-08-30 10:32:27 +02:00
oliexdev
7be6b9575c This commit introduces the ability to select and apply body composition formulas (Body Fat, Body Water, LBM) within the measurement type detail screen. 2025-08-29 20:17:15 +02:00
oliexdev
96143e6a25 Configured a debug build type in build.gradle.kts with an applicationIdSuffix of ".debug" and versionNameSuffix of "-debug". 2025-08-29 15:55:55 +02:00
oliexdev
ac8e27fbfb This commit introduces a new setting in the General Settings screen that allows users to enable or disable haptic feedback (vibration) when a new measurement is received and refactored BleConnector to use MeasurementFacade for saving measurements. 2025-08-29 15:33:39 +02:00
oliexdev
7bce0be76b This commit introduces a new home screen widget that displays the latest value for a selected measurement type. 2025-08-29 12:21:43 +02:00
oliexdev
2901a3a520 The notification icon has been scaled down to better fit the notification bar. 2025-08-27 09:31:00 +02:00
oliexdev
ac968424ae The reminder notification now features a dedicated small icon (ic_notification_foreground) and uses the app's launcher icon (ic_launcher_foreground) as the large icon for improved visual clarity and consistency. 2025-08-27 09:23:56 +02:00
oliexdev
769a3db921 This commit introduces a new feature that groups snackbar messages when multiple measurements are saved in quick succession. Instead of displaying individual "Measurement saved" messages for each, a single message like "Saved X measurements" will now be shown.
Additionally, this commit:
- Improves the snackbar display logic to prevent duplicate messages and introduces a debounce mechanism.
- Enhances the Overview screen's scrolling behavior to smoothly scroll to the top when new items are added, and also improves the scroll behavior when tapping on chart points.
2025-08-26 18:18:30 +02:00
oliexdev
5e755382e1 Add reminder functionality 2025-08-25 17:36:26 +02:00
oliexdev
7013a41c2d Always show share/delete button for log files. Additionally, the app's version code has been incremented for the open beta build 2025-08-25 08:53:45 +02:00
oliexdev
b43b6f9828 Refactor BluetoothFacade and BluetoothViewModel for Snackbar handling 2025-08-23 16:59:39 +02:00
oliexdev
7e416f11b6 Refactored classes and packages to align with Android’s architecture recommendations (Hilt, lifecycle-aware state, unidirectional data flow) 2025-08-23 15:22:29 +02:00
oliexdev
940d47391b Refactor database migration to use getDefaultMeasurementTypes 2025-08-20 16:16:58 +02:00
oliexdev
3e966fbb7c Backfill derived values on app start if needed 2025-08-20 16:08:35 +02:00
oliexdev
4e5c24f7fe Refactor BluetoothCommunication handler usage
refactors the `BluetoothCommunication` class to use a single `mainHandler` for managing various delayed tasks like pre-scan timeouts, disconnect timeouts, and connection delays.
2025-08-20 12:07:16 +02:00
oliexdev
561b8e886a Update LogManager warning message and set BT_STATUS on disconnect 2025-08-20 11:39:08 +02:00
oliexdev
5d8d8165fc Refactors Bluetooth permission handling and connection logic across several parts of the application 2025-08-20 11:23:11 +02:00
oliexdev
9dc61d7e53 Refactor unique number generation for legacy scales. Additionally, fix corrected date parsing and history data for the MiScale2 driver: 2025-08-20 08:36:34 +02:00
oliexdev
01fd3214aa - Implemented a fileMutex to synchronize file access operations, preventing potential race conditions when writing to or exporting the log file.
- Increased `MAX_LOG_SIZE_BYTES` from 5 MiB to 10 MiB.
2025-08-19 21:07:26 +02:00
oliexdev
8c7a62c401 Implement database migration from version 6 to 7 2025-08-19 20:50:13 +02:00
oliexdev
f29bd962d2 Safeguard LogManager against concurrent file access 2025-08-19 19:11:00 +02:00
oliexdev
5f9d8f95dc Refactor BluetoothMiScale2 for improved history handling and more reliable skeletal muscle mass calculation in MiScaleLib using the Janssen BIA equation, with a fallback to a lean body mass ratio if impedance is unavailable. 2025-08-19 18:43:13 +02:00
oliexdev
94f23467ca Apply highlight color correctly for light theme 2025-08-18 18:28:05 +02:00
oliexdev
3a13162f9e Displays evaluation state symbols (▲, ▼, ●, !) next to values in table screen, similar to the overview screen. 2025-08-18 18:12:27 +02:00
oliexdev
cf6d834db7 Introduces a new framework for evaluating measurement values against reference ranges and displays this information in the UI. 2025-08-18 16:52:10 +02:00
oliexdev
220afffb33 Enable point selection on graph screen to show measurement details 2025-08-18 09:40:39 +02:00
oliexdev
3855d93046 Introduces a feature where selecting a point on the line chart in the OverviewScreen will scroll the measurement list to the corresponding item and highlight it temporarily. 2025-08-18 07:52:46 +02:00
oliexdev
8f7c15e0c5 Implement Automatic Database Backups 2025-08-17 19:25:01 +02:00
oliexdev
98cc2ba9f5 Add settings for chart data smoothing 2025-08-16 17:54:53 +02:00
oliexdev
4da84c8778 Adjust default icon and color for custom measurement types 2025-08-16 14:52:06 +02:00
oliexdev
4eed5ce2f7 Replace String-based icons with enum and introduce MeasurementIcon composable 2025-08-16 14:32:47 +02:00
oliexdev
d61670cc84 enhances unit conversion capabilities, particularly for BODY_FAT, WATER, and MUSCLE measurement types. These types can now be converted between percentage (%) and absolute mass units (kg, lb, st) 2025-08-16 10:36:18 +02:00
oliexdev
5b03c4bd89 Update default measurement type colors and units 2025-08-16 09:18:26 +02:00
oliexdev
a3d18a1258 Introduces a new "Chart Settings" screen accessible from the main settings menu. 2025-08-15 15:56:56 +02:00
oliexdev
365b1029c5 Fix sync selectedUser field in driver with setSelectedScaleUser() 2025-08-15 12:57:58 +02:00
oliexdev
cd991b4f18 Modifying the UserDetailScreen to use the localized gender display names. 2025-08-15 11:45:12 +02:00