mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Data binding fix: Update instead of replace states
This commit is contained in:
parent
8d0bddac6c
commit
35094a1667
@ -216,9 +216,7 @@
|
||||
},
|
||||
|
||||
_pushNewStates: function(new_states) {
|
||||
new_states.map(function(state) {
|
||||
this._pushNewState(state);
|
||||
}.bind(this));
|
||||
new_states.forEach(this._pushNewState.bind(this));
|
||||
},
|
||||
|
||||
// call api methods
|
||||
@ -238,11 +236,7 @@
|
||||
|
||||
fetchStates: function(onSuccess, onError) {
|
||||
var successStatesUpdate = function(newStates) {
|
||||
this._sortStates(newStates);
|
||||
|
||||
this.states = newStates.map(function(json) {
|
||||
return new State(json, this);
|
||||
}.bind(this));
|
||||
this._pushNewStates(newStates);
|
||||
|
||||
this.fire('states-updated');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user