Skip to content

Commit

Permalink
Fix for older browsers. Fixes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Feb 19, 2019
1 parent f9a58c8 commit be13234
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions auto-entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AutoEntities extends cardTools.litElement() {
this.data = {};

this.entities = this.get_entities() || [];
this.card = cardTools.createCard({entities: this.entities, ...config.card});
this.card = cardTools.createCard(Object.assign({entities: this.entities}, config.card));
}


Expand Down Expand Up @@ -134,7 +134,7 @@ class AutoEntities extends cardTools.litElement() {
const add = this.match_filter(this._hass, Object.keys(this._hass.states), f);
let toAdd = [];
add.forEach((i) => {
toAdd.push({entity: Object.keys(this._hass.states)[i], ...f.options});
toAdd.push(Object.assign({entity: Object.keys(this._hass.states)[i]}, f.options));
});
toAdd.sort((a,b) => {
if (a.entity < b.entity) return -1;
Expand Down Expand Up @@ -203,7 +203,7 @@ class AutoEntities extends cardTools.litElement() {
const newEntities = this.entities.map((e) => e.entity);

if(!this._compare_arrays(oldEntities, newEntities)) {
this.card.setConfig({entities: this.entities, ...this._config.card});
this.card.setConfig(Object.assign({entities: this.entities}, this._config.card));
this.requestUpdate();
}
});
Expand Down

0 comments on commit be13234

Please sign in to comment.