Skip to content

Commit

Permalink
Ensure attributes are assigned before accessed (#667)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkih authored May 8, 2022
1 parent a863edd commit 83ab86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export default class MediaPlayerObject {
this.config = config || {};
this.entity = entity || {};
this.state = entity.state;
this.idle = config.idle_view ? this.idleView : false;
this._entityId = (entity && entity.entity_id) || this.config.entity;
this._attr = entity.attributes;
this._attr = entity.attributes || {};
this.idle = config.idle_view ? this.idleView : false;
this._active = this.isActive;
}

Expand Down

0 comments on commit 83ab86c

Please sign in to comment.