home-card icon indicating copy to clipboard operation
home-card copied to clipboard

Release 2021.6.0 - 2021.6.0 broke Home-Card

Open keiferoh opened this issue 3 years ago • 10 comments

I love Home-Card. It is the centerpiece of my HA dashboard.

2021.6.0 appears to have broken Home-Card. Any thoughts?

Let me know what information you need, if you think can be corrected.

Screen Shot 2021-06-03 at 7 19 29 AM

keiferoh avatar Jun 03 '21 11:06 keiferoh

Yes, same thing on my side after update to 2021.6.0 image

groues avatar Jun 03 '21 13:06 groues

After investigation, this seems to be linked to the upgrade to Lit 2.0: https://developers.home-assistant.io/blog/2021/05/19/lit-2.0/ I have changed the header of the /home-card/home-card.js as follows and it seems to have done the trick without having to update the whole code.

` import { THEMES } from './themes.js'; import { LitElement, html, css } from "https://unpkg.com/[email protected]/lit-element.js?module";

// const LitElement = Object.getPrototypeOf( // customElements.get("ha-panel-lovelace") // ); // const html = LitElement.prototype.html; // const css = LitElement.prototype.css; `

groues avatar Jun 07 '21 08:06 groues

Actually, I have kept the './themes.js' in the home-card.js My frontend skills are close to none but from the 2021.6 breaking change notes I noticed that LitElement and lit-html have been deprecated in favor for Lit 2.0. I have just commented out these lines:

'const LitElement = Object.getPrototypeOf( customElements.get("ha-panel-lovelace") ); const html = LitElement.prototype.html; const css = LitElement.prototype.css;'

and added this instead:

'import { LitElement, html, css } from "https://unpkg.com/[email protected]/lit-element.js?module";'

groues avatar Jun 07 '21 11:06 groues

that looks like what I have, but it doesn't seem to cooperate with me here.

'import { LitElement, html, css } from "https://unpkg.com/[email protected]/lit-element.js?module";'

// const LitElement = Object.getPrototypeOf( // customElements.get("ha-panel-lovelace") // ); // const html = LitElement.prototype.html; // const css = LitElement.prototype.css;

const VERSION = 3;

keiferoh avatar Jun 07 '21 13:06 keiferoh

When any of you guys have anything that works, please open a PR so I can merge it. I'm quite passive when it comes to maintaining this project right now.

postlund avatar Jun 07 '21 13:06 postlund

Works fine on my side but I had to restart HA and clear my browser's cache first. Thanks for the good work BTW :)

groues avatar Jun 07 '21 14:06 groues

Sorry, I had not cleared my cache. Clearing my cache worked here, too.

keiferoh avatar Jun 07 '21 14:06 keiferoh

I have cleared cache and rebooted it still puts all the image parts to one side stacked on top of each other. I even changed the header to the information that Groues stated above but still no joy getting the images back into there right places. I love this card too and want it to work right.

gdreelin avatar Sep 13 '21 17:09 gdreelin

When any of you guys have anything that works, please open a PR so I can merge it. I'm quite passive when it comes to maintaining this project right now. @postlund #26 should take care if it.

avidit avatar Sep 15 '21 20:09 avidit

Merged!

postlund avatar Sep 15 '21 20:09 postlund