Mariusthvdb / custom-ui

Add templates and icon_color to Home Assistant UI
163 stars 30 forks source link

More-info on entity card and others dont hide attributes #39

Closed Mariusthvdb closed 3 years ago

Mariusthvdb commented 3 years ago

never noticed before but clicking an entity on an type: entity card doesn't respect the settings we set under hidden attributes. As on an custom:mini-graph-card.

tagging @CAB426 since you fixed this on the more-info before, please could you once more have a look?

eg: Lovelace card:

  - type: custom:mini-graph-card
    entities:
      - entity: sensor.co2_living
        name: Co2
      - entity: sensor.temperatuur_living
        name: Temp Living
      - entity: sensor.luchtvochtigheid_living
        name: Vocht
      - entity: sensor.schimmel_sensor
        name: Schimmel
    height: 100
    line_width: 4
    font_size: 75
    show:
      graph: true
      fill: true
      extrema: true

clicking the entity in the card results in:

Schermafbeelding 2021-05-16 om 23 23 23

while the same entity is correctly treated in a entities or glance card:

Schermafbeelding 2021-05-16 om 23 23 33

this happens on the latest version 20210511, but also on earlier versions. I guess the Lovelace cards use an other way of calling the more info on these cards, which I hope can be added to the updateMoreInfo() function in custom-ui.

Thanks if you could have a look

Mariusthvdb commented 3 years ago

got this help from Thomas Loven on Discord (Thank you Thomas):

I'd guess you're seeing timing differences. What you need to do is move one step at a time in that chain, and whenever there's a shadowRoot you check if the parent element has a updateComplete property, and if so await that before continuing. Here's a function I keep reusing for this sort of stuff: https://github.com/thomasloven/lovelace-card-tools/blob/master/src/helpers.js

Next up: figure out what that means for the updateMoreInfo() in custom-ui.js

Mariusthvdb commented 3 years ago

fixed in 2021.5.28 https://github.com/Mariusthvdb/custom-ui/releases/tag/2021.5.28