Skip to content

Commit

Permalink
Deep equal check on state hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bratanon authored Dec 29, 2023
1 parent b9eba31 commit 4998423
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ window.customUI = {
obj.states,
entity
);
if (hass.states && entity !== hass.states[key]) {
if (hass.states && JSON.stringify(entity) !== JSON.stringify(hass.states[key])) {
obj.states[key] = newEntity;
} else if (entity !== newEntity) {
} else if (JSON.stringify(entity) !== JSON.stringify(newEntity)) {
obj.states[key] = newEntity;
}
});
Expand Down

0 comments on commit 4998423

Please sign in to comment.