mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-10 12:09:27 +01:00
[Huawei] Hookup smart wakeup interval and update Coordinators
This commit is contained in:
parent
51024f7b5e
commit
71ea39efde
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class GetSmartAlarmList extends Request {
|
||||
0,
|
||||
smartAlarm.status,
|
||||
true,
|
||||
null,
|
||||
(int) smartAlarm.aheadTime,
|
||||
false,
|
||||
smartAlarm.repeat,
|
||||
smartAlarm.startHour,
|
||||
|
Loading…
Reference in New Issue
Block a user