Skip to content

Commit

Permalink
remove function initresol()
Browse files Browse the repository at this point in the history
  • Loading branch information
pdbjjens committed Feb 5, 2020
1 parent 760f10d commit 3db4361
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ class MyVbus extends utils.Adapter {
// in this vbus adapter all states changes inside the adapters namespace are subscribed
this.subscribeStates('*');

function initResol() {
//function initResol() {
ctx.headerSet = new vbus.HeaderSet();
//let forceReInit = self.config.forceReInit;
let ConnectionClass;
let ConnectionClass = vbus.ConnectionClass;
const ipformat = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
const serialformat = /^(COM|com)[0-9][0-9]?$|^\/dev\/tty.*$/;
ctx.hsc = new vbus.HeaderSetConsolidator({
Expand Down Expand Up @@ -131,7 +130,7 @@ class MyVbus extends utils.Adapter {
if (forceReInit) {
initDevice(deviceId, channelId, objectId, item);
}
self.setStateAsync(objectId, item.value, true);
self.setState(objectId, item.value, true);
});

if (forceReInit) {
Expand All @@ -146,7 +145,7 @@ class MyVbus extends utils.Adapter {

ctx.connection.connect();
ctx.hsc.startTimer();
}
//}

function initDevice(deviceId, channelId, objectId, item) {
self.setObjectNotExists(deviceId, {
Expand Down Expand Up @@ -199,7 +198,7 @@ class MyVbus extends utils.Adapter {
native: {}
});
}
initResol();
//initResol();
}

onUnload (callback) {
Expand Down

0 comments on commit 3db4361

Please sign in to comment.