1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 21:06:50 +01:00

[Huawei] Hookup smart wakeup interval and update Coordinators

This commit is contained in:
Martin.JM 2024-02-21 16:27:38 +01:00
parent 51024f7b5e
commit 71ea39efde
4 changed files with 8 additions and 14 deletions

View File

@ -116,6 +116,11 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
return huaweiCoordinator.supportsSmartAlarm(device, position);
}
@Override
public boolean supportsSmartWakeupInterval(GBDevice device, int alarmPosition) {
return supportsSmartWakeup(device, alarmPosition);
}
@Override
public boolean forcedSmartWakeup(GBDevice device, int alarmPosition) {
return huaweiCoordinator.forcedSmartWakeup(device, alarmPosition);
@ -136,12 +141,6 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
return true;
}
@Override
public boolean supportsAlarmDescription(GBDevice device) {
// TODO: only name is supported
return true;
}
@Override
public boolean supportsWeather() {
return huaweiCoordinator.supportsWeather();

View File

@ -141,12 +141,6 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
return true;
}
@Override
public boolean supportsAlarmDescription(GBDevice device) {
// TODO: only name is supported
return true;
}
@Override
public boolean supportsWeather() {
return huaweiCoordinator.supportsWeather();

View File

@ -60,6 +60,7 @@ public class AlarmsRequest extends Request {
}
public void buildSmartAlarm(Alarm alarm) {
Integer smartWakeupInterval = alarm.getSmartWakeupInterval();
this.smartAlarmRequest = new SmartAlarmRequest(
paramsProvider,
new Alarms.SmartAlarm(
@ -67,7 +68,7 @@ public class AlarmsRequest extends Request {
(byte) alarm.getHour(),
(byte) alarm.getMinute(),
(byte) alarm.getRepetition(),
(byte) 5 // TODO: setting for ahead time
smartWakeupInterval == null ? 5 : smartWakeupInterval.byteValue()
)
);
}

View File

@ -61,7 +61,7 @@ public class GetSmartAlarmList extends Request {
0,
smartAlarm.status,
true,
null,
(int) smartAlarm.aheadTime,
false,
smartAlarm.repeat,
smartAlarm.startHour,