Giter Club home page Giter Club logo

Comments (8)

Swampen avatar Swampen commented on June 10, 2024

Can you add your card configuration and any errors in the dev console (F12)

from air-visual-card.

jaruba avatar jaruba commented on June 10, 2024

@Swampen it's likely that me and @digidestination have the same issue

i recently updated ha and all the extensions including this one, under Overview -> Home i can see all the cards when i refresh the page, but while browsing around ha, the next time i get to Overview there are no cards at all..

dev tools shows this as the only error in lovelance:

air-visual-card.js?hacstag=157674859200:426 Uncaught TypeError: Cannot read properties of undefined (reading 'attributes')
    at HTMLElement.set hass [as hass] (air-visual-card.js?hacstag=157674859209:426)
    at HTMLElement.value (hui-masonry-view.ts:44)
    at HTMLElement.value (hui-masonry-view.ts:44)
    at HTMLElement.t.addEventListener.once (hui-masonry-view.ts:44)
    at i (typography.js:181)
    at ha-logbook.ts:28

which points to this line: https://github.com/dnguyen800/air-visual-card/blob/master/dist/air-visual-card.js#L426

and my card's config is:

type: custom:vertical-stack-in-card
title: Air Quality
cards:
  - type: custom:air-visual-card
    air_pollution_level: sensor.u_s_air_pollution_level_2
    air_quality_index: sensor.u_s_air_quality_index_2
    main_pollutant: sensor.u_s_main_pollutant_2
    city: Bucharest
    hide_title: true
    hide_weather: true

this error makes no sense to me though, as i don't set the weather property:
https://github.com/dnguyen800/air-visual-card/blob/master/dist/air-visual-card.js#L256

which means that weatherEntity should be '', so this should be falsey:
https://github.com/dnguyen800/air-visual-card/blob/master/dist/air-visual-card.js#L425

and thus the code should never reach the 426th line which is where the error is from

from air-visual-card.

jaruba avatar jaruba commented on June 10, 2024

@Swampen huh, i logged weatherEntity at the 426th line, and it's showing weather.home.. but I have no such entity.. and i never set weather in the card config or configuration.yaml...

from air-visual-card.

jaruba avatar jaruba commented on June 10, 2024

a few more tests i did:

weather.home
weather.my_home

and still got the error once.. this just gets stranger and stranger..

from air-visual-card.

jaruba avatar jaruba commented on June 10, 2024

@Swampen I created a PR for this: #56

from air-visual-card.

Swampen avatar Swampen commented on June 10, 2024

@jaruba Great! You found a solution.
I think maybe this line also might be causing some problems. https://github.com/dnguyen800/air-visual-card/blob/master/dist/air-visual-card-editor.js#L64
Did you by any chance configure it with the GUI?

I don't have contributer rights to this repo, so I can't do anything with your PR. @dnguyen800 needs to take a look at it.

from air-visual-card.

dnguyen800 avatar dnguyen800 commented on June 10, 2024

i'll update it today. Thanks for finding and fixing the issue!

from air-visual-card.

jaruba avatar jaruba commented on June 10, 2024

@dnguyen800 thanks! works great now

@Swampen yeah, i used the GUI to add the card and configure it, that default value shouldn't be used though.. weather.home is only available for those that never changed their HA's home name, as the weather entity name changes according to the HA home name. (ex: if i set the home name to "My Home", the weather entity becomes weather.my_home)

from air-visual-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.