Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center cards are redrawn on each render #48

Closed
z8i opened this issue Jan 8, 2021 · 5 comments
Closed

Center cards are redrawn on each render #48

z8i opened this issue Jan 8, 2021 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@z8i
Copy link

z8i commented Jan 8, 2021

Hello! I really enjoy the power distribution card and use it with an E3DC-System.
Now I tried to configure two gauge-cards as a vertical stack in the middle, this basically works, but the cards get redrawn like every other second. This looks somehow weird...

bug-darstellung.mp4

My code:

      - type: 'custom:power-distribution-card'
        title: ''
        entities:
          - decimals: 2
            display_abs: true
            name: solar
            unit_of_display: W
            icon: 'mdi:solar-power'
            producer: true
            entity: sensor.e3dc_pv_leistung
            preset: solar
          - decimals: 2
            display_abs: true
            name: grid
            unit_of_display: W
            icon: 'mdi:transmission-tower'
            entity: sensor.e3dc_netzleistung
            preset: grid
          - decimals: 2
            display_abs: true
            name: battery
            unit_of_display: W
            consumer: true
            icon: 'mdi:battery-outline'
            producer: true
            entity: sensor.e3dc_batterieleistung
            preset: battery
          - decimals: 2
            display_abs: true
            name: home
            unit_of_display: W
            consumer: true
            icon: 'mdi:home-assistant'
            entity: sensor.e3dc_hausleistung
            preset: home
        center:
          type: card
          content:
            type: vertical-stack
            cards:
              - type: gauge
                entity: sensor.e3dc_batterieladung
                min: 0
                max: 100
                name: Speicher
                severity:
                  green: 20
                  yellow: 10
                  red: 0
              - type: gauge
                entity: sensor.e3dc_autarkie
                min: 0
                max: 100
                name: Autarkie
                severity:
                  green: 85
                  yellow: 50
                  red: 0
        animation: slide

Is this caused by my configuration?

@JonahKr
Copy link
Owner

JonahKr commented Jan 8, 2021

Wunderschönen guten Abend 😉 / Good evening @z8i
I looked a bit into it and the issue seems to be on my end. The Browser Console already throws the error so i guess there is some issue with saving the card as a variable, so it gets created new for every render.
Thanks for reporting this i will try to fix it 👍

Take Care !

Jonah

@JonahKr JonahKr self-assigned this Jan 8, 2021
@JonahKr JonahKr added the bug Something isn't working label Jan 8, 2021
@JonahKr JonahKr added this to the 2.2 milestone Jan 8, 2021
@JonahKr JonahKr changed the title Center cards are redrawn very often Center cards are redrawn on each render Jan 8, 2021
@z8i
Copy link
Author

z8i commented Jan 13, 2021

Wunderschönen guten Abend! Thanks alot for your work on this one.

@JonahKr
Copy link
Owner

JonahKr commented Jan 29, 2021

Entschuldige, dass das gerade so lange dauert. Ich hab gerade Klausurenphase, daher wird das die nächsten Wochen wahrscheinlich auch noch nicht besser...
Ich hatte angefangen etwas zu recherchieren bin aber noch nicht wirklich schlauer aus der Sache geworden. Nur das Vermutete Problem war es nicht.

@z8i
Copy link
Author

z8i commented Jan 29, 2021

Alles gut, kein Stress! Wenns dringend wäre, hätte ich schon selbst Hand angelegt, aber Web-Kram ist nicht so meins. Außerdem ist das hier Freizeitvergnügen, keine Verpflichtungen!
Viel Erfolg bei den Klausuren!

@JonahKr
Copy link
Owner

JonahKr commented Mar 3, 2021

Anschienend hat 36ac6ea Das Problem behoben. Bin gerade erst zum Testen gekommen. Es gibt noch ein paar andere Bugs mit dem Laden der Karten, aber danach release ich den fix 👍

@JonahKr JonahKr closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants