GithubHelp home page GithubHelp logo

Comments (6)

Mariusthvdb avatar Mariusthvdb commented on August 22, 2024 1

about the template jinja change: this wont impact here.
It has all been about the change in HA 115 that made templates find the states much better than before, and hence the need for the 'entity_id:' line which was used for these cases is no linger required. If anything, the template sensors update far too frequently now (especially when using jinja like {{states|...} which would cause listeners for all states....).
because of that the new PRs are made to bring those down a bit. Any case, the template sensors for Powerwheel card didn't need the entity_id line at all, and are updating nicely, so no worries there for this card.

from power-wheel-card.

firstof9 avatar firstof9 commented on August 22, 2024 1

Confirming your change did indeed resolve the issue and the card is now rendering.

from power-wheel-card.

gurbyz avatar gurbyz commented on August 22, 2024

Thx Chris, for your early report. I'm not sure yet, but I think the card isn't acting well on implementing this architectural change in HA 0.116. Something to do with templates that update too often. Since power-wheel-card listens to many input sensors, it is a candidate to update too often. I tried to prevent that in 2019 by decreasing the amount of updates:

_sensorChangeDetected(oldValue) {
    return this.sensors.reduce((change, sensor) => {
      return change || this.hass.states[sensor].state !== oldValue.states[sensor].state;
    }, false);
  }

  shouldUpdate(changedProperties) {
    // Don't update when there is a new value for a hass property that's not a registered sensor.
    // Update in all other cases, e.g. when there is a change of config or old values are undefined.
    let update = true;
    Array.from(changedProperties.keys()).some((propName) => {
      const oldValue = changedProperties.get(propName);
      if (propName === "hass" && oldValue) {
        update = update && this._sensorChangeDetected(oldValue);
      }
      return !update;
    });
    return update;
  }

But in 0.116.0b1 I guess that's not working. I saw there were some fixes to the architectural change already in 0.116.0b2. I'm only running my production 0.115.x. Could you, by any change, check again in 0.116.0b2 for me?

I'll try to look for documentation how custom cards should cope with this architectural change in the mean time.

from power-wheel-card.

gurbyz avatar gurbyz commented on August 22, 2024

New hypothesis, because I was misreading the architectural change in HA a bit.

It's about a breaking change on template sensors. I found a pull request for that that's labeled with 'breaking change' for next release (0.116.0).

If users of the power-wheel-card will use template sensors as input and they are impacted by this breaking change, then their template sensors won't update as usual. If their template sensors won't update, the card won't detect and re-render.

(It's still a hypothesis though... but) could you check your template sensors? One use case that would have impact would be a template sensor that uses now().

from power-wheel-card.

gurbyz avatar gurbyz commented on August 22, 2024

Or: could be this announced breaking change for custom cards. Unfortunately the suggested solution to use hui-masonry-view doesn't work for me.

from power-wheel-card.

gurbyz avatar gurbyz commented on August 22, 2024

I released a new version of power-wheel-card: 0.1.3. I did a small fix to prevent impact by the breaking change for custom cards mentioned in my last message. It's not fixed like the blog suggests, because that didn't work. But I looked in other custom cards how it currently was done to get LitElement.

@firstof9 Chris, could you check if the new release does fix anything for you? If not, is there any error shown in HA or in the console?

from power-wheel-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.