Skip to content

Commit

Permalink
Merge pull request #41 from fewieden/develop
Browse files Browse the repository at this point in the history
2.0.2
  • Loading branch information
fewieden committed Oct 10, 2023
2 parents e4638b6 + 920207f commit a27333a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# MMM-AlarmClock Changelog

## [2.0.2]

### Fixed

* Timing of alert click handler registration

## [2.0.1]

### Fixed
Expand Down
21 changes: 11 additions & 10 deletions MMM-AlarmClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Module.register('MMM-AlarmClock', {
*/
notificationReceived(notification) {
if (notification === 'STOP_ALARM') {
this.resetAlarmClock()
this.resetAlarmClock();
}
},

Expand Down Expand Up @@ -216,16 +216,17 @@ Module.register('MMM-AlarmClock', {
this.timer = setTimeout(() => {
this.resetAlarmClock();
}, timer);
if (this.config.touch && this.config.popup) {
MM.getModules().enumerate(module => {
if (module.name === 'alert') {
module.alerts['MMM-AlarmClock'].ntf.addEventListener('click', () => {
this.resetAlarmClock();
});
}
});
}
setTimeout(() => {
if (this.config.touch && this.config.popup) {
MM.getModules().enumerate(module => {
if (module.name === 'alert') {
module.alerts['MMM-AlarmClock'].ntf.addEventListener('click', () => {
this.resetAlarmClock();
});
}
});
}

const player = document.getElementById('MMM-AlarmClock-Player');
player.volume = this.config.fade ? 0 : this.config.volume;
this.fadeAlarm();
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mmm-alarmclock",
"version": "2.0.1",
"version": "2.0.2",
"description": "Alarm Clock Module for MagicMirror2",
"scripts": {
"lint": "./node_modules/.bin/eslint . && ./node_modules/.bin/stylelint .",
Expand Down

0 comments on commit a27333a

Please sign in to comment.