Skip to content

Commit

Permalink
fix(ha-websocket): Reset states/servicesLoaded on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
zachowj committed Apr 7, 2019
1 parent 67857b5 commit 9af4807
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/ha-websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ class HaWebsocket extends EventEmitter {
this.emit('ha_events:error', err);
}

this.servicesLoaded = false;
this.statesLoaded = false;

if (this.client && this.client.readyState === this.client.CLOSED) {
this.connectionState = HaWebsocket.DISCONNECTED;
this.emit('ha_events:close');
Expand Down
2 changes: 1 addition & 1 deletion nodes/events-state-changed/events-state-changed.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@

<div class="form-row">
<input type="checkbox" id="node-input-outputinitially" style="display: inline-block; width: auto; vertical-align: top;margin-left: 105px;">
<label for="node-input-outputinitially" style="width: auto;">Output Initially / On Deploy</label>
<label for="node-input-outputinitially" style="width: auto;">Output on Connect</label>
</div>
</script>

Expand Down
2 changes: 1 addition & 1 deletion nodes/poll-state/poll-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@

<div class="form-row">
<input type="checkbox" id="node-input-outputinitially" style="display: inline-block; width: auto; vertical-align: top;margin-left: 105px;">
<label for="node-input-outputinitially" style="width: auto;">Output Initially / On Deploy</label>
<label for="node-input-outputinitially" style="width: auto;">Output on Connect</label>
</div>
</script>

Expand Down
2 changes: 1 addition & 1 deletion nodes/trigger-state/trigger-state.html
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ <h3>Add Outputs</h3>

<div class="form-row">
<input type="checkbox" id="node-input-outputinitially" style="display: inline-block; width: auto; vertical-align: top;">
<label for="node-input-outputinitially" style="width: auto;">Output Initially / On Deploy</label>
<label for="node-input-outputinitially" style="width: auto;">Output on Connect</label>
</div>

<div class="form-row">
Expand Down

0 comments on commit 9af4807

Please sign in to comment.