Update main.js
This commit is contained in:
parent
9305b4aad3
commit
690fc3afa3
23
main.js
23
main.js
@ -297,5 +297,28 @@ function main() {
|
||||
});
|
||||
|
||||
|
||||
// try to load certificates
|
||||
if (adapter.config.secure) {
|
||||
// Load certificates
|
||||
// Load certificates
|
||||
adapter.getCertificates(function (err, certificates, leConfig) {
|
||||
adapter.config.certificates = certificates;
|
||||
adapter.config.leConfig = leConfig;
|
||||
initWebServer(adapter.config);
|
||||
});
|
||||
} else {
|
||||
initWebServer(adapter.config);
|
||||
}
|
||||
|
||||
// Convert port to number
|
||||
adapter.config.interval = parseInt(adapter.config.interval, 10);
|
||||
|
||||
// If interval and URl are set => poll it every X milliseconds
|
||||
if (adapter.config.interval && adapter.config.pollURL) {
|
||||
// initial poll
|
||||
pollData();
|
||||
// poll every x milliseconds
|
||||
timer = setInterval(pollData, adapter.config.interval);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user