Skip to content

Commit

Permalink
Merge pull request #29 from fewieden/develop
Browse files Browse the repository at this point in the history
Fading / Korean
  • Loading branch information
fewieden authored Apr 28, 2020
2 parents 9e906ad + 381c243 commit e4638b6
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# MMM-AlarmClock Changelog

## [2.0.1]

### Fixed

* Fading of alert sound.

### Added

* Korean translations

## [2.0.0]

### Added
Expand Down
7 changes: 4 additions & 3 deletions MMM-AlarmClock.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ Module.register('MMM-AlarmClock', {
en: 'translations/en.json',
de: 'translations/de.json',
fr: 'translations/fr.json',
id: 'translations/id.json'
id: 'translations/id.json',
ko: 'translations/ko.json'
};
},

Expand Down Expand Up @@ -239,10 +240,10 @@ Module.register('MMM-AlarmClock', {
* @returns {void}
*/
fadeAlarm() {
let volume = 0;
let volume = this.config.fade ? 0 : this.config.volume;
let counter = 0;
const player = document.getElementById('MMM-AlarmClock-Player');
this.fadeInterval = setInterval(() => {
const player = document.getElementById('MMM-AlarmClock-Player');
player.volume = volume;
volume += this.config.fadeStep;
counter += 1000;
Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@ Alarm Clock Module for MagicMirror<sup>2</sup>

## Example

![](.github/example.jpg) ![](.github/example2.jpg)
![Active alarm](.github/example.jpg) ![Scheduled alarm](.github/example2.jpg)

## Dependencies

* An installation of [MagicMirror<sup>2</sup>](https://github.com/MichMich/MagicMirror)

## Installation

1. Clone this repo into `~/MagicMirror/modules` directory.
1. Configure your `~/MagicMirror/config/config.js`:

```
{
module: 'MMM-AlarmClock',
position: 'top_right',
config: {
alarms: [
{time: "18:30", days: [2,4], title: "Soccer", message: "Get ready for soccer training!", sound: "alarm.mp3"},
...
],
* Clone this repo into `~/MagicMirror/modules` directory.
* Configure your `~/MagicMirror/config/config.js`:

```js
{
module: 'MMM-AlarmClock',
position: 'top_right',
config: {
alarms: [
{time: "18:30", days: [2,4], title: "Soccer", message: "Get ready for soccer training!", sound: "alarm.mp3"},
...
}
],
...
}
```
}
```

## Config Options

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.0",
"version": "2.0.1",
"description": "Alarm Clock Module for MagicMirror2",
"scripts": {
"lint": "./node_modules/.bin/eslint . && ./node_modules/.bin/stylelint .",
Expand Down
2 changes: 1 addition & 1 deletion templates/MMM-AlarmClock.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{% if not next %}
<div class="dimmed light">{{ 'LOADING' | translate }}</div>
{% elif alarmFired %}
<audio id="MMM-AlarmClock-Player" src="{{ src }}" autoplay loop />
<audio id="MMM-AlarmClock-Player" src="{{ src }}" autoplay loop volume="0" />
{% else %}
<div class="small">{{ next.title }}: {{ next.moment.format(config.format) }}</div>
{% endif %}
4 changes: 4 additions & 0 deletions translations/ko.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"LOADING": "로딩 중...",
"ALARM_CLOCK": "알람 시계"
}

0 comments on commit e4638b6

Please sign in to comment.