multitimer: fix `settings` & `alarm` scope

pull/2781/head
Rob Pilling 2023-06-30 21:04:20 +01:00
parent 887acfe346
commit 56401ea183
1 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,8 @@ function startHM() {
}
function buzz() {
let buzzCount = 3 * require("sched").getSettings().buzzCount;
const settings = require("sched").getSettings();
let buzzCount = 3 * settings.buzzCount;
require("buzz").pattern(alarm.vibrate === undefined ? "::" : alarm.vibrate).then(() => {
if (buzzCount--) {
@ -78,6 +79,7 @@ function buzz() {
let alarms = require("sched").getAlarms();
let active = require("sched").getActiveAlarms(alarms);
let alarm = active[0];
// active[0] is a HM alarm (otherwise we'd have triggered sched.js instead of this file)
startHM();
buzz();