1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-24 20:55:49 +00:00

Add compatibility for Lit 2.0 (#8878)

This commit is contained in:
Bram Kragten
2021-05-07 22:16:14 +02:00
committed by GitHub
parent 0f58214ba1
commit 9f032a61a9
521 changed files with 2512 additions and 2510 deletions

View File

@@ -1,9 +1,9 @@
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
internalProperty,
state,
LitElement,
TemplateResult,
} from "lit-element";
@@ -20,7 +20,7 @@ import { HomeAssistant } from "../../../src/types";
class CastDemoRow extends LitElement implements LovelaceRow {
public hass!: HomeAssistant;
@internalProperty() private _castManager?: CastManager | null;
@state() private _castManager?: CastManager | null;
public setConfig(_config: CastConfig): void {
// No config possible.
@@ -73,7 +73,7 @@ class CastDemoRow extends LitElement implements LovelaceRow {
this.style.display = this._castManager ? "" : "none";
}
static get styles(): CSSResult {
static get styles(): CSSResultGroup {
return css`
:host {
display: flex;

View File

@@ -1,9 +1,9 @@
import "@material/mwc-button";
import {
css,
CSSResult,
CSSResultGroup,
html,
internalProperty,
state,
LitElement,
property,
TemplateResult,
@@ -26,7 +26,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
@property({ attribute: false }) public hass!: MockHomeAssistant;
@internalProperty() private _switching?: boolean;
@state() private _switching?: boolean;
private _hidden = localStorage.hide_demo_card;
@@ -113,7 +113,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
}
}
static get styles(): CSSResult[] {
static get styles(): CSSResultGroup {
return [
css`
a {