mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 05:16:51 +01:00
Merge branch 'master' into background-javascript
This commit is contained in:
commit
f0a9c57937
@ -140,15 +140,18 @@ public class AmazfitBipSupport extends MiBand2Support {
|
||||
|
||||
@Override
|
||||
public void onSendWeather(WeatherSpec weatherSpec) {
|
||||
if (gbDevice.getFirmwareVersion() == null) {
|
||||
LOG.warn("Device not initialized yet, so not sending weather info");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
TransactionBuilder builder = performInitialized("Sending weather forecast");
|
||||
boolean supportsConditionString = false;
|
||||
|
||||
if (gbDevice.getFirmwareVersion() != null) {
|
||||
Version version = new Version(gbDevice.getFirmwareVersion());
|
||||
if (version.compareTo(new Version("0.0.8.74")) >= 0) {
|
||||
supportsConditionString = true;
|
||||
}
|
||||
Version version = new Version(gbDevice.getFirmwareVersion());
|
||||
if (version.compareTo(new Version("0.0.8.74")) >= 0) {
|
||||
supportsConditionString = true;
|
||||
}
|
||||
|
||||
final byte NR_DAYS = 2;
|
||||
|
@ -1064,7 +1064,6 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
queueAlarm(alarm, builder, characteristic);
|
||||
iteration++;
|
||||
}
|
||||
builder.queue(getQueue());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@ -1309,8 +1308,11 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
|
||||
|
||||
public void phase2Initialize(TransactionBuilder builder) {
|
||||
LOG.info("phase2Initialize...");
|
||||
enableFurtherNotifications(builder, true);
|
||||
requestBatteryInfo(builder);
|
||||
}
|
||||
|
||||
public void phase3Initialize(TransactionBuilder builder) {
|
||||
LOG.info("phase3Initialize...");
|
||||
setDateDisplay(builder);
|
||||
setTimeFormat(builder);
|
||||
setWearLocation(builder);
|
||||
|
@ -117,7 +117,9 @@ public class InitOperation extends AbstractBTLEOperation<MiBand2Support> {
|
||||
TransactionBuilder builder = createTransactionBuilder("Authenticated, now initialize phase 2");
|
||||
builder.add(new SetDeviceStateAction(getDevice(), GBDevice.State.INITIALIZING, getContext()));
|
||||
getSupport().requestDeviceInfo(builder);
|
||||
getSupport().enableFurtherNotifications(builder, true);
|
||||
getSupport().phase2Initialize(builder);
|
||||
getSupport().phase3Initialize(builder);
|
||||
getSupport().setInitialized(builder);
|
||||
getSupport().performImmediately(builder);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user