ljmerza / light-entity-card

Control any light or switch entity
MIT License
228 stars 41 forks source link

Color Wheel not showing for Hue Lights #109

Closed Imoriarty closed 1 year ago

Imoriarty commented 1 year ago

Card Version: 6.0.6

HA Versions: Home Assistant 2023.5.4 Supervisor 2023.04.1 Operating System 10.2 Frontend 20230503.3 - latest

Chrome console shows an error trying to load the Color Wheel:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach') at Xd.updated (light-entity-card.js:7024:35) at Xd._$AE (light-entity-card.js:955:16) at Xd.performUpdate (light-entity-card.js:940:21) at Xd.scheduleUpdate (light-entity-card.js:912:21) at light-entity-card.js:907:21 at Generator.throw () at n (light-entity-card.js:56:19) at g (light-entity-card.js:72:11)

The JS block that references:

updated() {
    (this._isUpdating = !1),
      this._shownStateObjects.forEach((a) => {
        var b = this.generateColorPickerId(a),
          c = this.shadowRoot.querySelectorAll("#".concat(b));
        if (c.length) {
          var d = (a.attributes.hs_color && a.attributes.hs_color[0]) || 0,
            e =
              (a.attributes.hs_color && a.attributes.hs_color[1] / 100) ||
              0;
          c[0].desiredHsColor = { h: d, s: e };
        }
      });
Imoriarty commented 1 year ago

Apologies - I forced a re-download of the resource and cleared cache and now the color wheels appear!

Thanks so much for your work!