thomasloven / lovelace-state-switch

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

FR: add type: row #80

Open Mariusthvdb opened 2 years ago

Mariusthvdb commented 2 years ago

please consider adding type: row to the available options, so we can use state-switch inside an entities card:

  type: entities
  entities:
      - type: custom:state-switch
        entity: binary_sensor.zomertijd
        states:
          'on':
             type: row
             entity: binary_sensor.zomertijd
          'off':
             type: row
             entity: binary_sensor.wintertijd

this would be way more elegant than having to use the condition in each row in core Lovelace:

    entities:
      - type: conditional
        conditions:
          - entity: binary_sensor.zomertijd
            state: 'on'
        row:
          entity: binary_sensor.zomertijd
      - type: conditional
        conditions:
          - entity: binary_sensor.wintertijd
            state: 'on'
        row:
          entity: binary_sensor.wintertijd
ildar170975 commented 2 years ago

I do not know whether it is possible or not for the current implementation. But from the user's point of view - it would be great to use state-switch for rows (it has much more features that the stock conditional card/row).