kalkih / mini-media-player

Minimalistic media card for Home Assistant Lovelace UI
MIT License
1.49k stars 205 forks source link

Error when using idle view #658

Closed rappenze closed 2 years ago

rappenze commented 2 years ago

After update of the mini-media-player to version 1.16.3 the option idle_view: when_standby does not work anymore. When using the card without that option it is displyed correctly.

This issue occurs with HA version 2022.5.0.

With this option the following error is shown:

mini-media-player-bundle.js?hacstag=1485208381163:200 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'media_position_updated_at')
    at se.get updatedAt [as updatedAt] (mini-media-player-bundle.js?hacstag=1485208381163:200:12621)
    at se.get idleView [as idleView] (mini-media-player-bundle.js?hacstag=1485208381163:200:14440)
    at new se (mini-media-player-bundle.js?hacstag=1485208381163:200:11856)
    at Me.set hass [as hass] (mini-media-player-bundle.js?hacstag=1485208381163:1389:377)
    at vertical-stack-in-card.js?hacstag=142051833042:118:19
    at Array.forEach (<anonymous>)
    at VerticalStackInCard.set hass [as hass] (vertical-stack-in-card.js?hacstag=142051833042:117:22)
    at c.value (hui-light-card.ts:35:1)
    at c._$AE (styles.ts:368:1)
    at c.performUpdate (styles.ts:368:1)

image

kalkih commented 2 years ago

Thanks for letting me know, will take a look tomorrow, probably a mistake when converting the code to typescript.

kalkih commented 2 years ago

After taking a closer look at your config, I noticed that it's invalid.

idle view should look like this:

...
idle_view:
  when_standby: true
rappenze commented 2 years ago

Thanks for the info. But the same error occurs as well with the fixed config.

kalkih commented 2 years ago

Fixed with the latest release 🤞🏼