mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-02-18 05:17:08 +01:00
Bangle.js: Allow enable/disable alarms
This commit is contained in:
parent
28783ce146
commit
2bda160fb5
@ -1212,13 +1212,14 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
|||||||
o.put("d", jsonalarms);
|
o.put("d", jsonalarms);
|
||||||
|
|
||||||
for (Alarm alarm : alarms) {
|
for (Alarm alarm : alarms) {
|
||||||
if (!alarm.getEnabled()) continue;
|
if (alarm.getUnused()) continue;
|
||||||
JSONObject jsonalarm = new JSONObject();
|
JSONObject jsonalarm = new JSONObject();
|
||||||
jsonalarms.put(jsonalarm);
|
jsonalarms.put(jsonalarm);
|
||||||
//Calendar calendar = AlarmUtils.toCalendar(alarm);
|
//Calendar calendar = AlarmUtils.toCalendar(alarm);
|
||||||
jsonalarm.put("h", alarm.getHour());
|
jsonalarm.put("h", alarm.getHour());
|
||||||
jsonalarm.put("m", alarm.getMinute());
|
jsonalarm.put("m", alarm.getMinute());
|
||||||
jsonalarm.put("rep", alarm.getRepetition());
|
jsonalarm.put("rep", alarm.getRepetition());
|
||||||
|
jsonalarm.put("on", alarm.getEnabled());
|
||||||
}
|
}
|
||||||
uartTxJSON("onSetAlarms", o);
|
uartTxJSON("onSetAlarms", o);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user