thomasloven / lovelace-state-switch

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

How to use same card for multiple mobile devices? #8

Closed shreram closed 5 years ago

shreram commented 5 years ago

How to utilize the same content for multiple mobile devices?

I have the following snippet for one mobile device and that works fine for that particular device. But would like to use this for all mobile devices.

      - type: custom:state-switch
        entity: browser
        default: 'b770c707-d0949aef'
        states:
         'b770c707-d0949aef': # laptop
          ....
          ....
          '01123618-da34c6e4': # mobile
            type: custom:layout-card
            layout: auto
            cards:
              - type: custom:vertical-stack-in-card
                cards:
                  - type: 'custom:card-modder'
                    style:
                      border-radius: 15px
                      --paper-card-background-color: 'rgba(0, 0, 0, 0.0)'
                      box-shadow: 2px 2px rgba(0,0,0,0.0)
                      padding: 0px 10px
                      height: 33px
                      # content will be shown in orange color
                      color: rgb(230, 138, 0)
                    card:
                      content: '### Switches'
                      type: markdown
thomasloven commented 5 years ago

Yaml node anchors http://thomasloven.com/blog/2018/08/YAML-For-Nonprogrammers/