A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
MMM-AlarmClock append / push to alarms array
-
I’m trying to append alarm objects to the alarms array
This is my code so far.// SET ALARM if(notification === "SET_ALARM"){ var mqttData = JSON.parse(payload); this.config.alarms.push({time: mqttData.hour+":"+mqttData.min, days: [1,2,3,4,5,6,7], sound: "alarm.mp3", title: "Alarm", message: mqttData.msg}); this.updateDom(300); console.log("alarm obj: "+this.config.alarms); }
However, in the console it shows only one alarm object.
Note: I have one alarm set in the config file
-
This post is deleted! -
I removed the Dom update and it seems to work.
-
@axellejamous be aware of that day 7 doesn’t exist the days range from 0 sunday to 6 saturday
-
@strawberry-3.141 changed, thank you!