Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105660

Is there a way to reduce this Lovelace code?

$
0
0

In an effort to reduce my lovelace code I’ve tried several ways of reducing this code but haven’t found a way. The only difference is the font-weight, any suggestions?

      - type: conditional
        conditions:
          - entity: sensor.room_presence
            state: 'BR2'
        elements:
          - type: state-label
            entity: input_text.br2
            tap_action:
              action: none
            hold_action:
              action: none
            style:
              top: *row_03
              left: *column_1
              max-width: 1px
              font-weight: *font_700
#              font-weight: "${states['sensor.room_presence'].state === 'BR2' ? 700 : 400}"
      - type: conditional
        conditions:
          - entity: sensor.room_presence
            state_not: 'BR2'
        elements:
          - type: state-label
            entity: input_text.br2
            tap_action:
              action: none
            hold_action:
              action: none
            style:
              top: *row_03
              left: *column_1
              font-weight: *font_400
              max-width: 1px

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105660

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>