-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskicast.js
60 lines (48 loc) · 1.17 KB
/
skicast.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// skicast.js
Module.register("skicast", {
// default module config
defaults: {
location: false,
locationID: false,
lat: false,
lon: false,
appid: '',
units = config.units,
updateInterval: 15 * 60 * 1000, // every 15 minutes
animationSpeed: 1000,
timeFormat: config.timeFormat,
lang: config.language,
decimalSymbol: '.',
fade: false,
initialLoaddelay: 2500, //2.5 seconds
retryDelay: 2500,
apiBase: 'https://api.weatherunlocked.com/',
weatherProvider: 'weatherunlocked',
},
getScripts: function () {
return ['moment.js']
},
start: function () {
Log.info("starting module: " + this.name);
//set locale
moment.locale(config.language);
this.forecast = [];
this.loaded = false;
this.scheduleUpdate(this.config.initialLoaddelay);
this.updateTimer = null;
},
// override dom generator
getDom: function () {
var wrapper = document.createElement('div');
if (this.config.appid = "") {
wrapper.innerHTML = "Please set correct appid in config module";
wrapper.className = 'dimed light small';
return wrapper
}
},
loaded: function(callback) {
this.finishloading();
Log.log(this.name + ' is loaded!');
callback();
}
})