thomasloven / lovelace-state-switch

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

"default" case has stopped working in v1.9+ #61

Closed rccoleman closed 2 years ago

rccoleman commented 2 years ago

I've been using state-switch for quite a while with a user state that includes one explicit string that will match and a default case that should be active when the user doesn't match the first case. It's been working great until 1.9 & 1.91, where the default case appears to be ignored and nothing is displayed if there are no explicit matches. I slightly modified the example from the card docs and can reproduce the issue:

  - badges: []
    title: state-switch-test
    panel: true
    cards:
    - type: custom:state-switch
      entity: user
      default: default
      states:
        Rob:
          type: entities
          title: User A stuff
          entities:
            - switch.fr_table_lamp
        Mobile:
          type: entities
          title: User B stuff
          entities:
            - switch.fr_reading_lamp
        default:
          type: markdown
          content: >
            ## Unknown user

If the logged-in user is "Rob", I see the card for "Rob". If I change "Rob" to "Desktop", no card is displayed. I would expect the default case to take effect and a markdown card to be displayed. All testing done with "Flush cache and hard reload" and in Chrome.

ildar170975 commented 2 years ago

Have to confirm the issue.

Qpernicus commented 2 years ago

Can confirm this issue with the use of a weather-card entity.

Already used various weather entities

lukou31 commented 2 years ago

I have the same issue since I have upgraded this card yesterday. It's a huge issue for me because this card is the corner stone of my lovelace dashboard.

Different mode used; hash, ...

And finally, I have performed a roll back of this card from my backup system and after having flushed the browser cache it's working as before the upgrade. So it's a bug !

hmmbob commented 2 years ago

Yeah, seeing the same issue here.