thomasloven / lovelace-state-switch

🔹Dynamically replace lovelace cards depending on occasion
MIT License
382 stars 27 forks source link

iframe under 0.107.5 #27

Closed Mace404 closed 4 years ago

Mace404 commented 4 years ago

Hi, I just updated my HA from 0.106.6 to 107.5 and have the following state-switch card:

  - type: custom:state-switch
    entity: user
    default: default
    states:
      user1:
        type: custom:state-switch
        entity: person.user1
        states:
          home:
            type: iframe
            url: !secret squeezebox_url
            aspect_ratio: 150%
      user2:
        type: custom:state-switch
        entity: person.user2
        states:
          home:
            type: iframe
            url: !secret squeezebox_url
            aspect_ratio: 150%
      default:
        type: markdown
        content: >
          ## Unknown user

On 0.106.6 this properly shows the iframe to my mediaserver when I'm at home and hides it when I'm not. After the update I get the following error: Custom element doesn't exist: hui-iframe-card.

When I add a dummy iframe card on the same lovelace view like this:

  - type: iframe
    url: ' '
    aspect_ratio: 0%

The state-switch card is shown normally again.