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) {
|
_pushNewStates: function(new_states) {
|
||||||
new_states.map(function(state) {
|
new_states.forEach(this._pushNewState.bind(this));
|
||||||
this._pushNewState(state);
|
|
||||||
}.bind(this));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// call api methods
|
// call api methods
|
||||||
@ -238,11 +236,7 @@
|
|||||||
|
|
||||||
fetchStates: function(onSuccess, onError) {
|
fetchStates: function(onSuccess, onError) {
|
||||||
var successStatesUpdate = function(newStates) {
|
var successStatesUpdate = function(newStates) {
|
||||||
this._sortStates(newStates);
|
this._pushNewStates(newStates);
|
||||||
|
|
||||||
this.states = newStates.map(function(json) {
|
|
||||||
return new State(json, this);
|
|
||||||
}.bind(this));
|
|
||||||
|
|
||||||
this.fire('states-updated');
|
this.fire('states-updated');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user