From 48ed724256abf0bf2cd574885d9ca9874d7a7e19 Mon Sep 17 00:00:00 2001 From: mamutcho Date: Sun, 15 Dec 2019 19:40:20 +0200 Subject: [PATCH] Sync with Gadgetbridge --- .../lenovo/watchxplus/WatchXPlusDeviceSupport.java | 12 +++++++++++- app/src/main/res/xml/watchxplus_preferences.xml | 6 ++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/lenovo/watchxplus/WatchXPlusDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/lenovo/watchxplus/WatchXPlusDeviceSupport.java index 23f92b21d..80a9eae7d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/lenovo/watchxplus/WatchXPlusDeviceSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/lenovo/watchxplus/WatchXPlusDeviceSupport.java @@ -730,8 +730,18 @@ public class WatchXPlusDeviceSupport extends AbstractBTLEDeviceSupport { @Override public void onFetchRecordedData(int dataTypes) { - TransactionBuilder builder; + // get battery state + try { + builder = performInitialized("getBatteryInfo"); + builder.write(getCharacteristic(WatchXPlusConstants.UUID_CHARACTERISTIC_WRITE), + buildCommand(WatchXPlusConstants.CMD_BATTERY_INFO, + WatchXPlusConstants.READ_VALUE)); + builder.queue(getQueue()); + } catch (IOException e) { + LOG.warn("Unable to retrieve battery data", e); + } + try { builder = performInitialized("fetchData"); diff --git a/app/src/main/res/xml/watchxplus_preferences.xml b/app/src/main/res/xml/watchxplus_preferences.xml index 7be6108e9..b06fab593 100644 --- a/app/src/main/res/xml/watchxplus_preferences.xml +++ b/app/src/main/res/xml/watchxplus_preferences.xml @@ -108,14 +108,12 @@ android:inputType="number" android:key="pref_wxp_bp_calibration_low" android:defaultValue="80" - android:title="@string/pref_wxp_bp_calibration_low" - android:summary="@string/pref_rtl_max_line_length_summary"/> + android:title="@string/pref_wxp_bp_calibration_low" /> + android:title="@string/pref_wxp_bp_calibration_high" />