Skip to content

Commit

Permalink
Bugfix: State attribute definition missing for : online
Browse files Browse the repository at this point in the history
State attribute definition missing for : online with value : false
  • Loading branch information
DutchmanNL committed Jun 4, 2022
1 parent da1db5b commit 7c6e753
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ class Wled extends utils.Adapter {
this.devices[deviceIP].wsConnected = false;
// Update device working state
if (this.devices[deviceIP].mac != null) {
this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'online', false);
this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'Online status', false);
}
}
// Close socket
Expand Down Expand Up @@ -801,7 +801,7 @@ class Wled extends utils.Adapter {
this.devices[deviceIP].connected = false;
this.devices[deviceIP].initialized = false;
this.devices[deviceIP].wsConnected = false;
await this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'online', false);
await this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'Online status', false);
return 'failed';
} else {
this.log.debug(`Heartbeat of device ${deviceIP} successfully`);
Expand All @@ -824,7 +824,7 @@ class Wled extends utils.Adapter {
this.devices[deviceIP].initialized = false;
// Update device working state
if (this.devices[deviceIP].mac != null) {
await this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'online', {val: false, ack: true});
await this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'Online status', {val: false, ack: true});
}
return 'failed';
} else {
Expand All @@ -842,7 +842,7 @@ class Wled extends utils.Adapter {
if (this.devices[deviceIP] && this.devices[deviceIP].connected){
this.log.warn(`Device ${deviceIP} offline, will try to reconnect`);
if (this.devices[deviceIP].mac != null) {
await this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'online', {val: false, ack: true});
await this.create_state(this.devices[deviceIP].mac + '._info' + '._online', 'Online status', {val: false, ack: true});
}
this.devices[deviceIP].connected = false;
this.devices[deviceIP].wsConnected = false;
Expand Down

0 comments on commit 7c6e753

Please sign in to comment.