diff --git a/src/model.ts b/src/model.ts index 28e3fb3..7501cd5 100644 --- a/src/model.ts +++ b/src/model.ts @@ -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; }