Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions cast/src/launcher/layout/hc-cast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import "@polymer/paper-listbox/paper-listbox";
import { Auth, Connection } from "home-assistant-js-websocket";
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
LitElement,
property,
internalProperty,
state,
TemplateResult,
} from "lit-element";
import { CastManager } from "../../../../src/cast/cast_manager";
Expand Down Expand Up @@ -42,9 +42,9 @@ class HcCast extends LitElement {

@property() public castManager!: CastManager;

@internalProperty() private askWrite = false;
@state() private askWrite = false;

@internalProperty() private lovelaceConfig?: LovelaceConfig | null;
@state() private lovelaceConfig?: LovelaceConfig | null;

protected render(): TemplateResult {
if (this.lovelaceConfig === undefined) {
Expand Down Expand Up @@ -204,7 +204,7 @@ class HcCast extends LitElement {
}
}

static get styles(): CSSResult {
static get styles(): CSSResultGroup {
return css`
.center-item {
display: flex;
Expand Down
18 changes: 9 additions & 9 deletions cast/src/launcher/layout/hc-connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import {
} from "home-assistant-js-websocket";
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
LitElement,
TemplateResult,
internalProperty,
state,
} from "lit-element";
import { CastManager, getCastManager } from "../../../../src/cast/cast_manager";
import { castSendShowDemo } from "../../../../src/cast/receiver_messages";
Expand Down Expand Up @@ -60,19 +60,19 @@ const INTRO = html`

@customElement("hc-connect")
export class HcConnect extends LitElement {
@internalProperty() private loading = false;
@state() private loading = false;

// If we had stored credentials but we cannot connect,
// show a screen asking retry or logout.
@internalProperty() private cannotConnect = false;
@state() private cannotConnect = false;

@internalProperty() private error?: string | TemplateResult;
@state() private error?: string | TemplateResult;

@internalProperty() private auth?: Auth;
@state() private auth?: Auth;

@internalProperty() private connection?: Connection;
@state() private connection?: Connection;

@internalProperty() private castManager?: CastManager | null;
@state() private castManager?: CastManager | null;

private openDemo = false;

Expand Down Expand Up @@ -297,7 +297,7 @@ export class HcConnect extends LitElement {
}
}

static get styles(): CSSResult {
static get styles(): CSSResultGroup {
return css`
.card-content a {
color: var(--primary-color);
Expand Down
4 changes: 2 additions & 2 deletions cast/src/launcher/layout/hc-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from "home-assistant-js-websocket";
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
LitElement,
Expand Down Expand Up @@ -69,7 +69,7 @@ class HcLayout extends LitElement {
}
}

static get styles(): CSSResult {
static get styles(): CSSResultGroup {
return css`
:host {
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions cast/src/receiver/layout/hc-demo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
customElement,
html,
internalProperty,
state,
property,
TemplateResult,
} from "lit-element";
Expand All @@ -21,7 +21,7 @@ import "./hc-lovelace";
class HcDemo extends HassElement {
@property({ attribute: false }) public lovelacePath!: string;

@internalProperty() private _lovelaceConfig?: LovelaceConfig;
@state() private _lovelaceConfig?: LovelaceConfig;

protected render(): TemplateResult {
if (!this._lovelaceConfig) {
Expand Down
4 changes: 2 additions & 2 deletions cast/src/receiver/layout/hc-launch-screen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
LitElement,
Expand Down Expand Up @@ -29,7 +29,7 @@ class HcLaunchScreen extends LitElement {
`;
}

static get styles(): CSSResult {
static get styles(): CSSResultGroup {
return css`
:host {
display: block;
Expand Down
4 changes: 2 additions & 2 deletions cast/src/receiver/layout/hc-lovelace.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
LitElement,
Expand Down Expand Up @@ -91,7 +91,7 @@ class HcLovelace extends LitElement {
return undefined;
}

static get styles(): CSSResult {
static get styles(): CSSResultGroup {
return css`
:host {
min-height: 100vh;
Expand Down
15 changes: 5 additions & 10 deletions cast/src/receiver/layout/hc-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import {
getAuth,
UnsubscribeFunc,
} from "home-assistant-js-websocket";
import {
customElement,
html,
internalProperty,
TemplateResult,
} from "lit-element";
import { customElement, html, state, TemplateResult } from "lit-element";
import { CAST_NS } from "../../../../src/cast/const";
import {
ConnectMessage,
Expand Down Expand Up @@ -36,13 +31,13 @@ let resourcesLoaded = false;

@customElement("hc-main")
export class HcMain extends HassElement {
@internalProperty() private _showDemo = false;
@state() private _showDemo = false;

@internalProperty() private _lovelaceConfig?: LovelaceConfig;
@state() private _lovelaceConfig?: LovelaceConfig;

@internalProperty() private _lovelacePath: string | number | null = null;
@state() private _lovelacePath: string | number | null = null;

@internalProperty() private _error?: string;
@state() private _error?: string;

private _unsubLovelace?: UnsubscribeFunc;

Expand Down
8 changes: 4 additions & 4 deletions demo/src/custom-cards/cast-demo-row.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
internalProperty,
state,
LitElement,
TemplateResult,
} from "lit-element";
Expand All @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions demo/src/custom-cards/ha-demo-card.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import "@material/mwc-button";
import {
css,
CSSResult,
CSSResultGroup,
html,
internalProperty,
state,
LitElement,
property,
TemplateResult,
Expand All @@ -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;

Expand Down Expand Up @@ -113,7 +113,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
}
}

static get styles(): CSSResult[] {
static get styles(): CSSResultGroup {
return [
css`
a {
Expand Down
4 changes: 2 additions & 2 deletions gallery/src/demos/demo-automation-trace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
css,
LitElement,
TemplateResult,
internalProperty,
state,
property,
} from "lit-element";
import "../../../src/components/ha-card";
Expand All @@ -22,7 +22,7 @@ const traces: DemoTrace[] = [basicTrace, motionLightTrace];
export class DemoAutomationTrace extends LitElement {
@property({ attribute: false }) hass?: HomeAssistant;

@internalProperty() private _selected = {};
@state() private _selected = {};

protected render(): TemplateResult {
if (!this.hass) {
Expand Down
6 changes: 3 additions & 3 deletions gallery/src/demos/demo-integration-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
customElement,
html,
css,
internalProperty,
state,
LitElement,
TemplateResult,
property,
Expand Down Expand Up @@ -220,9 +220,9 @@ const createDeviceRegistryEntries = (
export class DemoIntegrationCard extends LitElement {
@property({ attribute: false }) hass?: HomeAssistant;

@internalProperty() isCustomIntegration = false;
@state() isCustomIntegration = false;

@internalProperty() isCloud = false;
@state() isCloud = false;

protected render(): TemplateResult {
if (!this.hass) {
Expand Down
4 changes: 2 additions & 2 deletions hassio/src/addon-store/hassio-addon-repository.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mdiArrowUpBoldCircle, mdiPuzzle } from "@mdi/js";
import {
css,
CSSResultArray,
CSSResultGroup,
html,
LitElement,
property,
Expand Down Expand Up @@ -129,7 +129,7 @@ class HassioAddonRepositoryEl extends LitElement {
navigate(this, `/hassio/addon/${ev.currentTarget.addon.slug}`);
}

static get styles(): CSSResultArray {
static get styles(): CSSResultGroup {
return [
hassioStyle,
css`
Expand Down
8 changes: 4 additions & 4 deletions hassio/src/addon-store/hassio-addon-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "@material/mwc-list/mwc-list-item";
import { mdiDotsVertical } from "@mdi/js";
import {
css,
CSSResult,
internalProperty,
CSSResultGroup,
state,
LitElement,
property,
PropertyValues,
Expand Down Expand Up @@ -58,7 +58,7 @@ class HassioAddonStore extends LitElement {

@property({ attribute: false }) public route!: Route;

@internalProperty() private _filter?: string;
@state() private _filter?: string;

public async refreshData() {
await reloadHassioAddons(this.hass);
Expand Down Expand Up @@ -218,7 +218,7 @@ class HassioAddonStore extends LitElement {
this._filter = e.detail.value;
}

static get styles(): CSSResult {
static get styles(): CSSResultGroup {
return css`
hassio-addon-repository {
margin-top: 24px;
Expand Down
16 changes: 8 additions & 8 deletions hassio/src/addon-view/config/hassio-addon-audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
internalProperty,
state,
LitElement,
property,
PropertyValues,
Expand Down Expand Up @@ -39,15 +39,15 @@ class HassioAddonAudio extends LitElement {

@property({ attribute: false }) public addon!: HassioAddonDetails;

@internalProperty() private _error?: string;
@state() private _error?: string;

@internalProperty() private _inputDevices?: HassioHardwareAudioDevice[];
@state() private _inputDevices?: HassioHardwareAudioDevice[];

@internalProperty() private _outputDevices?: HassioHardwareAudioDevice[];
@state() private _outputDevices?: HassioHardwareAudioDevice[];

@internalProperty() private _selectedInput!: null | string;
@state() private _selectedInput!: null | string;

@internalProperty() private _selectedOutput!: null | string;
@state() private _selectedOutput!: null | string;

protected render(): TemplateResult {
return html`
Expand Down Expand Up @@ -109,7 +109,7 @@ class HassioAddonAudio extends LitElement {
`;
}

static get styles(): CSSResult[] {
static get styles(): CSSResultGroup {
return [
haStyle,
hassioStyle,
Expand Down
4 changes: 2 additions & 2 deletions hassio/src/addon-view/config/hassio-addon-config-tab.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
css,
CSSResult,
CSSResultGroup,
customElement,
html,
LitElement,
Expand Down Expand Up @@ -70,7 +70,7 @@ class HassioAddonConfigDashboard extends LitElement {
`;
}

static get styles(): CSSResult[] {
static get styles(): CSSResultGroup {
return [
haStyle,
hassioStyle,
Expand Down
Loading