Merge remote-tracking branch 'origin/fossil-q-hr' into fossil-q-hr

# Conflicts:
#	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/qhybrid/adapter/fossil_hr/FossilHRWatchAdapter.java
This commit is contained in:
dakhnod 2020-01-02 02:08:46 +01:00
commit 1e2b0ce242

View File

@ -1,6 +1,8 @@
package nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.requests.fossil_hr.configuration;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.model.GenericItem;
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.QHybridSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.qhybrid.adapter.fossil_hr.FossilHRWatchAdapter;
@ -37,6 +39,11 @@ public class ConfigurationGetRequest extends FileEncryptedLookupAndGetRequest {
device.setBatteryLevel((short) ((ConfigurationPutRequest.BatteryConfigItem) item).getBatteryPercentage());
device.setBatteryVoltage(((ConfigurationPutRequest.BatteryConfigItem) item).getBatteryVoltage() / 1000f);
device.setBatteryThresholdPercent((short) 15);
GBDeviceEventBatteryInfo batteryInfo = new GBDeviceEventBatteryInfo();
batteryInfo.level = (short) ((ConfigurationPutRequest.BatteryConfigItem) item).getBatteryPercentage();
batteryInfo.state = BatteryState.BATTERY_NORMAL;
getAdapter().getDeviceSupport().handleGBDeviceEvent(batteryInfo);
}
}