thomasloven / lovelace-state-switch

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

Strange "mediaquery" processing #62

Closed ildar170975 closed 2 years ago

ildar170975 commented 2 years ago

1.9.0: There is a view:

title: state-switch-2
path: test-view-state-switch-2
badges: []
cards:

  - type: custom:state-switch
    entity: mediaquery
    default: all
    transition_time: 500
    states:
      '(orientation: portrait)':
        type: entities
        title: portrait
        entities: &ref_entities
          - sun.sun
          - zone.home
      all:
        type: entities
        title: others (portrait)
        entities: *ref_entities

  - type: custom:state-switch
    entity: mediaquery
    default: all
    transition_time: 500
    states:
      '(orientation: landscape)':
        type: entities
        title: landscape
        entities: *ref_entities
      all:
        type: entities
        title: others (landscape)
        entities: *ref_entities

How it looks on PC (Win10x64, Chrome): image

How it looks on iPad (iOS companion App): in portrait orientation: image

in landscape orientation: image

So, in iOS it works properly. Why on PC it does not show the "others (portrait)" entities card?

ildar170975 commented 2 years ago

1.9.1: a new error: After update the "others (portrait)" is not displayed on iPad in landscape orientation

ildar170975 commented 2 years ago

I removed the default: "all" line - and everything came to OK. I think that this issue may be CLOSED. The "default" problem = another issue (https://github.com/thomasloven/lovelace-state-switch/issues/61)