Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMellerin committed Nov 26, 2018
1 parent ca1c2b5 commit b5c83fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
16 changes: 7 additions & 9 deletions app/plugins/miscellanea/alarm-clock/UIConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"enabled",
"hour",
"minute",
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday",
"sunday"
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday",
"sunday"
]
},
"content": [
Expand Down Expand Up @@ -391,8 +391,6 @@
"value":59,
"label": "59"
}


],
"visibleIf": {
"field": "enabled",
Expand Down
18 changes: 9 additions & 9 deletions app/plugins/miscellanea/alarm-clock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ AlarmClock.prototype.clearJobs = function () {

AlarmClock.prototype.applyConf = function(conf) {
var self = this;

for (var i in conf) {
var item = conf[i];
var d = new Date(item.time);
Expand All @@ -150,25 +150,25 @@ AlarmClock.prototype.applyConf = function(conf) {
var schedule = require('node-schedule');
var rule = new schedule.RecurrenceRule();
rule.dayOfWeek = [];
if (item.monday) {
if (item.monday) {
rule.dayOfWeek.push(1);
}
if (item.tuesday) {
if (item.tuesday) {
rule.dayOfWeek.push(2);
}
if (item.wednesday) {
if (item.wednesday) {
rule.dayOfWeek.push(3);
}
if (item.thursday) {
if (item.thursday) {
rule.dayOfWeek.push(4);
}
if (item.friday) {
if (item.friday) {
rule.dayOfWeek.push(5);
}
if (item.saturday) {
if (item.saturday) {
rule.dayOfWeek.push(6);
}
if (item.sunday) {
if (item.sunday) {
rule.dayOfWeek.push(7);
}
rule.minute = d.getMinutes();
Expand Down Expand Up @@ -280,7 +280,7 @@ AlarmClock.prototype.getSleep = function()
var sleep_action = sleepTask.sleep_action;
if (sleepTask.sleep_action == "stop") {
var sleep_actionText = self.commandRouter.getI18nString('ALARM.STOP_MUSIC');
} else if (sleepTask.sleep_action == "poweroff"){
} else if (sleepTask.sleep_action == "poweroff") {
var sleep_actionText = self.commandRouter.getI18nString('ALARM.TURN_OFF');
}
} else {
Expand Down

0 comments on commit b5c83fd

Please sign in to comment.