forked from Blendman974/faceclaw
Implement a bunch of features for alarm reliability
This commit is contained in:
1 parent
f601a62c75
commit
74199390d2
18 files changed
+2011
-282
No files matched your search
@@ -16,14 +16,19 @@ const timerApp: AppDefinition = {
|
||||
boot: (ctx) => {
|
||||
timerEngine.boot({
|
||||
playBuzzer: (payload) => ctx.actions.playBuzzerSequence(payload),
|
||||
onRing: () => {
|
||||
onRing: (item) => {
|
||||
// Bring the ringing item on screen: focus the Timers window, then
|
||||
// wake the display if it is off (a setting, since a wearer may
|
||||
// prefer the phone notification alone while the glasses sleep).
|
||||
// prefer the phone alone while the glasses sleep). Only once it is
|
||||
// actually showing does the phone start its acknowledgement clock;
|
||||
// otherwise the phone adds its own sound within seconds.
|
||||
void ctx
|
||||
.launchApp("timer")
|
||||
.then(() => {
|
||||
if (timersWakeSetting.get() && !shell.isScreenOn()) shell.wake("window");
|
||||
if (shell.isScreenOn() && shell.foregroundWindow()?.windowId === TIMER_WINDOW_ID) {
|
||||
timerEngine.markDeliveredToGlasses(item);
|
||||
}
|
||||
})
|
||||
.catch((error) => console.error(`timers ring launch failed: ${error}`));
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user