mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-02-04 04:54:10 +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);
|
return huaweiCoordinator.supportsSmartAlarm(device, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsSmartWakeupInterval(GBDevice device, int alarmPosition) {
|
||||||
|
return supportsSmartWakeup(device, alarmPosition);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean forcedSmartWakeup(GBDevice device, int alarmPosition) {
|
public boolean forcedSmartWakeup(GBDevice device, int alarmPosition) {
|
||||||
return huaweiCoordinator.forcedSmartWakeup(device, alarmPosition);
|
return huaweiCoordinator.forcedSmartWakeup(device, alarmPosition);
|
||||||
@ -136,12 +141,6 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsAlarmDescription(GBDevice device) {
|
|
||||||
// TODO: only name is supported
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsWeather() {
|
public boolean supportsWeather() {
|
||||||
return huaweiCoordinator.supportsWeather();
|
return huaweiCoordinator.supportsWeather();
|
||||||
|
@ -141,12 +141,6 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean supportsAlarmDescription(GBDevice device) {
|
|
||||||
// TODO: only name is supported
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsWeather() {
|
public boolean supportsWeather() {
|
||||||
return huaweiCoordinator.supportsWeather();
|
return huaweiCoordinator.supportsWeather();
|
||||||
|
@ -60,6 +60,7 @@ public class AlarmsRequest extends Request {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void buildSmartAlarm(Alarm alarm) {
|
public void buildSmartAlarm(Alarm alarm) {
|
||||||
|
Integer smartWakeupInterval = alarm.getSmartWakeupInterval();
|
||||||
this.smartAlarmRequest = new SmartAlarmRequest(
|
this.smartAlarmRequest = new SmartAlarmRequest(
|
||||||
paramsProvider,
|
paramsProvider,
|
||||||
new Alarms.SmartAlarm(
|
new Alarms.SmartAlarm(
|
||||||
@ -67,7 +68,7 @@ public class AlarmsRequest extends Request {
|
|||||||
(byte) alarm.getHour(),
|
(byte) alarm.getHour(),
|
||||||
(byte) alarm.getMinute(),
|
(byte) alarm.getMinute(),
|
||||||
(byte) alarm.getRepetition(),
|
(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,
|
0,
|
||||||
smartAlarm.status,
|
smartAlarm.status,
|
||||||
true,
|
true,
|
||||||
null,
|
(int) smartAlarm.aheadTime,
|
||||||
false,
|
false,
|
||||||
smartAlarm.repeat,
|
smartAlarm.repeat,
|
||||||
smartAlarm.startHour,
|
smartAlarm.startHour,
|
||||||
|
Loading…
Reference in New Issue
Block a user