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

Release 2021.6.0 - 2021.6.0 broke Home-Card #25

Open
keiferoh opened this issue Jun 3, 2021 · 10 comments
Open

Release 2021.6.0 - 2021.6.0 broke Home-Card #25

keiferoh opened this issue Jun 3, 2021 · 10 comments

Comments

@keiferoh
Copy link

keiferoh commented Jun 3, 2021

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

@groues
Copy link

groues commented Jun 3, 2021

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

@groues
Copy link

groues commented Jun 7, 2021

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
Copy link

groues commented Jun 7, 2021

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";'

@keiferoh
Copy link
Author

keiferoh commented Jun 7, 2021

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;

@postlund
Copy link
Owner

postlund commented Jun 7, 2021

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.

@groues
Copy link

groues commented Jun 7, 2021

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

@keiferoh
Copy link
Author

keiferoh commented Jun 7, 2021

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

@gdreelin
Copy link

gdreelin commented Sep 13, 2021

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.

@avidit
Copy link
Contributor

avidit commented Sep 15, 2021

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.

@postlund
Copy link
Owner

Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants