forked from f00d4tehg0dz/MMM-TeslaFi
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDataSource.js
More file actions
21 lines (17 loc) · 565 Bytes
/
DataSource.js
File metadata and controls
21 lines (17 loc) · 565 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* This is the base class for any extension that provides a source for data
*/
class DataSource {
// Called when this provider is loaded, provides a copy of the configuration of this provider only
constructor(config) {
this.config = config;
this.callback = null;
}
// Called when the main module is started
// Throws an exception if the configuration is not correct
start() {}
// Called when we want to get new data from TeslaFi
// This should be overridden in any sub-classes
fetchData(callback) {}
}
module.exports = DataSource;