1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-01-13 19:27:33 +01:00

Perform battery config when new device is being paired

This commit is contained in:
vanous 2021-11-06 08:08:20 +01:00
parent aa7c7f785a
commit 77cf6f8ba4

View File

@ -73,7 +73,12 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
@Override
public GBDevice createDevice(GBDeviceCandidate candidate) {
return new GBDevice(candidate.getDevice().getAddress(), candidate.getName(), null, getDeviceType());
GBDevice gbDevice = new GBDevice(candidate.getDevice().getAddress(), candidate.getName(), null, getDeviceType());
for (BatteryConfig batteryConfig : getBatteryConfig()) {
gbDevice.setBatteryIcon(batteryConfig.getBatteryIcon(), batteryConfig.getBatteryIndex());
gbDevice.setBatteryLabel(batteryConfig.getBatteryLabel(), batteryConfig.getBatteryIndex());
}
return gbDevice;
}
@Override