-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.js
41 lines (33 loc) · 849 Bytes
/
settings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
var settings = require('./settings.json');
/**
*
* Day 0 Sunday
* Day 1 Monday
* Day 2 Tuesday
*/
var Settings = function(){
this.settings = settings;
}
Settings.prototype.getSettings = function() {
return this.settings;
}
Settings.prototype.getAlarmSettings = function() {
return this.settings['sunrise'];
}
Settings.prototype.getAlarmForDay = function(dayNumber) {
var alarmSettings = this.getAlarmSettings();
return alarmSettings.days[dayNumber].alarm;
}
Settings.prototype.location = function() {
return this.settings.preferences.location;
}
Settings.prototype.latitude = function() {
return this.location().latitude;
}
Settings.prototype.setLatitude = function(latitude) {
return this.location().latitude = latitude;
}
Settings.prototype.longitude = function() {
return this.location().longitude;
}
module.exports = Settings;