marcokreeft87 / room-card

Show multiple entity states, attributes and icons in a single card in Home Assistant's Lovelace UI
MIT License
230 stars 38 forks source link

Entities added to "info_entities" are not centered #339

Closed almirus closed 3 months ago

almirus commented 5 months ago

Which version of Room Card? ROOM-CARD 1.08.03

Describe the bug I added several entities to the "info_entities" list, including icons and plain text. The text elements are centered along with the header, but the icons are "floating." All icons are from the "Material Design Icons" collection.

Expected behavior centered icons

Screenshots image

Desktop (please complete the following information):

YAML

- entity: binary_sensor.dvizhenie_v_gostinoi
    show_icon: true
    icon:
      template:
        icon: >
          if (entity.state == 'on') return 'mdi:home';  else return
          'mdi:home-variant-outline';
  - entity: sensor.smartmi_evaporative_humidifier_water_level
    show_icon: true
    icon:
      template:
        styles: >
          if (entity.state >= 70) return 'color: green';   if (entity.state >=
          20) return 'color: blue';   else return 'color: orangered';
        icon: >
          if (entity.state >= 70) return 'mdi:cup';   if (entity.state >= 20)
          return 'mdi:cup';   else return 'mdi:cup-off-outline';    
  - entity: sensor.gostinaia_vlazhnost_pochvy_soil_moisture
    show_icon: true
    icon:
      template:
        styles: >
          if (entity.state >= 80) return 'color: green';   if (entity.state >=
          60) return 'color: orangered';   else return 'color: red';
        icon: >
          if (entity.state >= 70) return 'mdi:flower-tulip';   if (entity.state
          >= 20) return 'mdi:flower-tulip';   else return
          'mdi:flower-tulip-outline'; 
  - entity: sensor.esphome_web_b7d4fc_co2
    show_icon: true
    icon:
      template:
        styles: >
          if (entity.state >= 1200) return 'color: red';    if (entity.state <
          1200) return 'color: green';
        icon: |
          'mdi:molecule-co2'; 
  - sensor.0xa4c13826b0d2f8ba_temperature
  - sensor.0xa4c13826b0d2f8ba_humidity
hugalafutro commented 3 months ago

I noticed the same the info entities shifted to the left noticeably, this happened after i updated ha container, although hacs autoupdates the addons so maybe I just rebuilt after this updated, anyway, it drives me up the wall, it was the very first thing i noticed after the container rebuilt. image

i don't think it's anything in yaml I haven't changed the cards in over a half a year, but maybe ha changed some interpretation of yaml? for reference first card yaml: https://o.o5.ddns.net/GDYGA 2nd card yaml: https://o.o5.ddns.net/HFmk0

marcokreeft87 commented 3 months ago

I noticed the same the info entities shifted to the left noticeably, this happened after i updated ha container, although hacs autoupdates the addons so maybe I just rebuilt after this updated, anyway, it drives me up the wall, it was the very first thing i noticed after the container rebuilt. image

i don't think it's anything in yaml I haven't changed the cards in over a half a year, but maybe ha changed some interpretation of yaml? for reference first card yaml: https://o.o5.ddns.net/GDYGA 2nd card yaml: https://o.o5.ddns.net/HFmk0

This is something different. Might be your theme or that you use a stack in card.

marcokreeft87 commented 3 months ago

@almirus Can you share your entire yaml of the card?

marcokreeft87 commented 3 months ago

Close because of no answer to questions