thomasloven / lovelace-template-entity-row

🔹 Display whatever you want in an entities card row.
MIT License
210 stars 16 forks source link

Wrong card display in UI #1

Closed jacekpaszkowski closed 4 years ago

jacekpaszkowski commented 4 years ago

First, thank you for very nice and useful card :)

I have samll a problem, card row looks bad in UI, could you please take a look?

2020-01-04_00h55_19

mgiako commented 4 years ago

I have a similar problem with long texts: shouldn't it be right aligned like the normal entity row? The second "Sito" line is made with lovelace-template-entity-row.

image

thomasloven commented 4 years ago

@jacekpaszkowski Since this issue seems to contain two different problems, please confirm if 7e4846f fixed your issue.

jacekpaszkowski commented 4 years ago

@thomasloven in my case there is still problem, even in version 9ba2826

image

thomasloven commented 4 years ago

Could you please provide an MWE?

jacekpaszkowski commented 4 years ago
active: '{{ is_state(''input_boolean.manual_on_fan_salon_humiditifier_2'', ''on'') }}'
icon: 'mdi:gesture-tap'
name: Włączony ręcznie
state: >-
  {% if is_state('input_boolean.manual_on_fan_salon_humiditifier_2', 'on')%} tak
  {% else %} nie {% endif %}
type: 'custom:template-entity-row'
thomasloven commented 4 years ago

An entire card, please.

jacekpaszkowski commented 4 years ago

This is code of this one on the right.

So, this is the code of card on the left:

cards:
  - entities:
      - entity: fan.salon_humiditifier_2
      - entity: sensor.salon_air_humidity_state
      - entity: sensor.salon_air_humidity
      - entity: sensor.salon_air_humidifier_water_level
      - entity: input_select.salon_humidifier_mode
      - entity: binary_sensor.can_on_humidifier
      - entity: sensor.salon_air_humidifier_mode
    show_header_toggle: false
    title: Nawilżacz w salonie
    type: entities
  - entities:
      - entity: script.start_fan_salon_humiditifier_2_timer_input_number
      - entity: input_number.fan_salon_humiditifier_2_timer_duration
      - entity: timer.fan_salon_humiditifier_2
    show_header_toggle: false
    type: entities
  - card:
      cards:
        - active: >-
            {{ is_state('input_boolean.manual_on_fan_salon_humiditifier_2',
            'on') }}
          icon: 'mdi:gesture-tap'
          name: Włączony ręcznie
          state: >-
            {% if is_state('input_boolean.manual_on_fan_salon_humiditifier_2',
            'on')%} tak {% else %} nie {% endif %}
          type: 'custom:template-entity-row'
      type: 'custom:vertical-stack-in-card'
    conditions:
      - entity: fan.salon_humiditifier_2
        state: 'on'
    type: conditional
type: 'custom:vertical-stack-in-card'
thomasloven commented 4 years ago

Are you serious?

That's exactly the problem I was thinking it was as soon as I saw a notification about your question on my phone. But I was hoping that it wouldn't be this. Really, really, really hoping...

Allow me to point you to 20% of the (IN TOTAL 15!) lines of the README file: Skärmavbild 2020-01-07 kl  16 27 43

jacekpaszkowski commented 4 years ago

Hi,

my mistake. Sorry, i assumed that this is card templete, even i wasn't awere there is something like "row template" :(.

I've changed code:

cards:
  - entities:
      - entity: fan.salon_humiditifier_2
      - entity: sensor.salon_air_humidity_state
      - entity: sensor.salon_air_humidity
      - entity: sensor.salon_air_humidifier_water_level
      - entity: input_select.salon_humidifier_mode
      - entity: binary_sensor.can_on_humidifier
      - entity: sensor.salon_air_humidifier_mode
    show_header_toggle: false
    title: Nawilżacz w salonie
    type: entities
  - entities:
      - entity: script.start_fan_salon_humiditifier_2_timer_input_number
      - entity: input_number.fan_salon_humiditifier_2_timer_duration
      - entity: timer.fan_salon_humiditifier_2
    show_header_toggle: false
    type: entities
  - type: entities
    show_header_toggle: false
    entities:
      - type: 'custom:template-entity-row'
        active: >-
          {{ is_state('input_boolean.manual_on_fan_salon_humiditifier_2', 'on')
          }}
        icon: 'mdi:gesture-tap'
        name: Włączony ręcznie
        state: >-
          {% if is_state('input_boolean.manual_on_fan_salon_humiditifier_2',
          'on')%} tak {% else %} nie {% endif %}
        condition: '{{is_state(''fan.salon_humiditifier_2'', ''on'')}}'
type: 'custom:vertical-stack-in-card'

Now it looks ok. But is there any option to eliminate this big space before row?

image

thomasloven commented 4 years ago

Yes... put it in the same entities card you already have there for all the other stuff. Why is this even a vertical-stack-in-card at all?