Skip to content

Commit

Permalink
fix(entity): Only save payload to disk if resend is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
zachowj committed Nov 6, 2021
1 parent 24c5410 commit f847e11
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/controllers/entity/Sensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,13 @@ class Sensor extends EntityNode {
state: state,
attributes: attr,
};
this.lastPayload = {
state: state,
attributes: attr,
};
this.storage.saveData('lastPayload', this.lastPayload);
if (this.nodeConfig.resend) {
this.lastPayload = {
state: state,
attributes: attr,
};
this.storage.saveData('lastPayload', this.lastPayload);
}
this.debugToClient(payload);

this.homeAssistant
Expand Down

0 comments on commit f847e11

Please sign in to comment.