upgrade lit (#2458)

* upgrade lit

* Lint
This commit is contained in:
Paulus Schoutsen 2019-01-12 23:32:53 -08:00 committed by GitHub
parent 0f53b7c832
commit b0d32b5674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
108 changed files with 499 additions and 367 deletions

View File

@ -1,12 +1,11 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import "@polymer/paper-button/paper-button";
import "../../../src/components/ha-card";
import { longPress } from "../../../src/panels/lovelace/common/directives/long-press-directive";
export class DemoUtilLongPress extends LitElement {
public render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
${

View File

@ -17,7 +17,6 @@
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
"license": "Apache-2.0",
"dependencies": {
"@material/mwc-ripple": "^0.3.1",
"@mdi/svg": "^3.0.39",
"@polymer/app-layout": "^3.0.1",
"@polymer/app-localize-behavior": "^3.0.1",
@ -35,7 +34,6 @@
"@polymer/iron-media-query": "^3.0.1",
"@polymer/iron-pages": "^3.0.1",
"@polymer/iron-resizable-behavior": "^3.0.1",
"@polymer/lit-element": "0.6.2",
"@polymer/neon-animation": "^3.0.1",
"@polymer/paper-button": "^3.0.1",
"@polymer/paper-card": "^3.0.1",
@ -78,7 +76,8 @@
"jquery": "^3.3.1",
"js-yaml": "^3.12.0",
"leaflet": "^1.3.4",
"lit-html": "0.12.0",
"lit-element": "2.0.0-rc.2",
"lit-html": "1.0.0-rc.2",
"marked": "^0.5.0",
"mdn-polyfills": "^5.12.0",
"moment": "^2.22.2",
@ -158,9 +157,7 @@
"@webcomponents/shadycss": "^1.6.0",
"@vaadin/vaadin-overlay": "3.2.2",
"@vaadin/vaadin-lumo-styles": "1.3.0",
"fecha": "https://github.com/taylorhakes/fecha/archive/5e8fe08d982647fdb19fb403459838b02647813c.tar.gz",
"lit-html": "0.12.0",
"@polymer/lit-element": "0.6.2"
"fecha": "https://github.com/taylorhakes/fecha/archive/5e8fe08d982647fdb19fb403459838b02647813c.tar.gz"
},
"main": "src/home-assistant.js",
"husky": {

View File

@ -1,5 +1,5 @@
import { litLocalizeLiteMixin } from "../mixins/lit-localize-lite-mixin";
import { LitElement, html, PropertyDeclarations } from "@polymer/lit-element";
import { LitElement, html, PropertyDeclarations } from "lit-element";
import "./ha-auth-flow";
import { AuthProvider } from "../data/auth";
@ -50,7 +50,7 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
};
}
public render() {
protected render() {
if (!this._authProviders) {
return html`
<p>[[localize('ui.panel.page-authorize.initializing')]]</p>

View File

@ -1,4 +1,4 @@
import { LitElement, html } from "@polymer/lit-element";
import { LitElement, html } from "lit-element";
import "./ha-progress-button";
import { fireEvent } from "../../common/dom/fire_event";

View File

@ -3,10 +3,10 @@ import {
html,
PropertyValues,
PropertyDeclarations,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import { HassEntity } from "home-assistant-js-websocket";
import { classMap } from "lit-html/directives/classMap";
import { classMap } from "lit-html/directives/class-map";
import computeStateDomain from "../../common/entity/compute_state_domain";
import computeStateName from "../../common/entity/compute_state_name";
@ -41,7 +41,7 @@ export class HaStateLabelBadge extends hassLocalizeLitMixin(LitElement) {
this.clearInterval();
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
const state = this.state;
if (!state) {

View File

@ -1,10 +1,11 @@
import {
html,
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult, html } from "lit-html";
import { classMap } from "lit-html/directives/classMap";
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import "./ha-icon";
class HaLabelBadge extends LitElement {
@ -24,7 +25,7 @@ class HaLabelBadge extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<div class="badge-container">

View File

@ -1,5 +1,5 @@
import { PolymerElement } from "@polymer/polymer";
import { Constructor } from "@polymer/lit-element";
import { Constructor } from "lit-element";
import { HASSDomEvent, ValidHassDomEvent } from "../../common/dom/fire_event";
interface RegisterDialogParams {

View File

@ -4,7 +4,7 @@ import "@polymer/iron-flex-layout/iron-flex-layout-classes";
import { html } from "@polymer/polymer/lib/utils/html-tag";
import { PolymerElement } from "@polymer/polymer/polymer-element";
import { afterNextRender } from "@polymer/polymer/lib/utils/render-status";
import { html as litHtml, LitElement } from "@polymer/lit-element";
import { html as litHtml, LitElement } from "lit-element";
import "../home-assistant-main";
import "../ha-init-page";

View File

@ -3,7 +3,7 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
} from "lit-element";
import { HomeAssistant } from "../types";
import { getActiveTranslation } from "../util/hass-translation";
import { LocalizeFunc, LocalizeMixin } from "./localize-base-mixin";

View File

@ -3,7 +3,7 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
} from "lit-element";
import { HomeAssistant } from "../types";
import {
localizeBaseMixin,

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-toggle-button/paper-toggle-button";
@ -23,7 +27,7 @@ export class CloudAlexaPref extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.cloudStatus) {
return html``;
}

View File

@ -3,8 +3,8 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import { repeat } from "lit-html/directives/repeat";
import "@polymer/paper-tooltip/paper-tooltip";
import { HassEntityBase } from "home-assistant-js-websocket";
@ -34,7 +34,7 @@ export class CloudExposedEntities extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._filterFunc) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-toggle-button/paper-toggle-button";
@ -24,7 +28,7 @@ export class CloudGooglePref extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.cloudStatus) {
return html``;
}

View File

@ -1,4 +1,4 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { html, LitElement, PropertyDeclarations } from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-input/paper-input";

View File

@ -3,7 +3,7 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
} from "lit-element";
import "@polymer/paper-toggle-button/paper-toggle-button";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-item/paper-item-body";

View File

@ -1,10 +1,14 @@
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-icon-button/paper-icon-button";
import { HassEntity } from "home-assistant-js-websocket";
import { TemplateResult } from "lit-html";
import { HASSDomEvent } from "../../../common/dom/fire_event";
import { Cluster } from "../../../data/zha";
import "../../../layouts/ha-app-layout";
@ -39,7 +43,7 @@ export class HaConfigZha extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<ha-app-layout>

View File

@ -4,12 +4,12 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
TemplateResult,
} from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-icon-button/paper-icon-button";
import { HassEntity } from "home-assistant-js-websocket";
import { TemplateResult } from "lit-html";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import {
@ -78,7 +78,7 @@ export class ZHAClusterAttributes extends LitElement {
super.update(changedProperties);
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<ha-config-section .isWide="${this.isWide}">

View File

@ -4,10 +4,10 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
TemplateResult,
} from "lit-element";
import "@polymer/paper-card/paper-card";
import { HassEntity } from "home-assistant-js-websocket";
import { TemplateResult } from "lit-html";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import {
@ -70,7 +70,7 @@ export class ZHAClusterCommands extends LitElement {
super.update(changedProperties);
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<ha-config-section .isWide="${this.isWide}">

View File

@ -4,9 +4,9 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
TemplateResult,
} from "lit-element";
import "@polymer/paper-card/paper-card";
import { TemplateResult } from "lit-html";
import { fireEvent } from "../../../common/dom/fire_event";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
@ -73,7 +73,7 @@ export class ZHAClusters extends LitElement {
super.update(changedProperties);
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this._renderStyle()}
<div class="node-picker">

View File

@ -4,12 +4,12 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
TemplateResult,
} from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
import { HassEntity } from "home-assistant-js-websocket";
import { TemplateResult } from "lit-html";
import { fireEvent } from "../../../common/dom/fire_event";
import { fetchEntitiesForZhaNode } from "../../../data/zha";
import "../../../resources/ha-style";
@ -62,7 +62,7 @@ export class ZHAEntities extends LitElement {
super.update(changedProperties);
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this._renderStyle()}
<div class="node-picker">

View File

@ -1,9 +1,13 @@
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-icon-button/paper-icon-button";
import { TemplateResult } from "lit-html";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-service-description";
import "../../../resources/ha-style";
@ -30,7 +34,7 @@ export class ZHANetwork extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<ha-config-section .isWide="${this.isWide}">

View File

@ -1,12 +1,16 @@
import "@polymer/iron-flex-layout/iron-flex-layout-classes";
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-card/paper-card";
import "@polymer/paper-icon-button/paper-icon-button";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
import { HassEntity } from "home-assistant-js-websocket";
import { TemplateResult } from "lit-html";
import { fireEvent, HASSDomEvent } from "../../../common/dom/fire_event";
import computeStateName from "../../../common/entity/compute_state_name";
import sortByName from "../../../common/entity/states_sort_by_name";
@ -64,7 +68,7 @@ export class ZHANode extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
this._nodes = this._computeNodes(this.hass);
return html`
${this.renderStyle()}

View File

@ -3,9 +3,9 @@ import {
LitElement,
PropertyValues,
PropertyDeclarations,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { classMap } from "lit-html/directives/classMap";
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import { LovelaceCard } from "../types";
import { HomeAssistant } from "../../../types";
@ -97,7 +97,7 @@ class HuiAlarmPanelCard extends hassLocalizeLitMixin(LitElement)
return true;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -3,8 +3,8 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import "../../../components/ha-card";
import "../components/hui-entities-toggle";
@ -95,7 +95,7 @@ class HuiEntitiesCard extends hassLocalizeLitMixin(LitElement)
}
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this._hass) {
return html``;
}

View File

@ -3,10 +3,10 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
TemplateResult,
} from "lit-element";
import { HassEntity } from "home-assistant-js-websocket";
import { TemplateResult } from "lit-html";
import { styleMap } from "lit-html/directives/styleMap";
import { styleMap } from "lit-html/directives/style-map";
import "../../../components/ha-card";
@ -82,7 +82,7 @@ class HuiEntityButtonCard extends hassLocalizeLitMixin(LitElement)
return true;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,8 +1,7 @@
import { html, LitElement } from "@polymer/lit-element";
import { html, LitElement, TemplateResult } from "lit-element";
import { LovelaceCard } from "../types";
import { LovelaceCardConfig } from "../../../data/lovelace";
import { TemplateResult } from "lit-html";
import { HomeAssistant } from "../../../types";
interface Config extends LovelaceCardConfig {
@ -40,7 +39,7 @@ export class HuiErrorCard extends LitElement implements LovelaceCard {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -3,9 +3,9 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { styleMap } from "lit-html/directives/styleMap";
TemplateResult,
} from "lit-element";
import { styleMap } from "lit-html/directives/style-map";
import "../../../components/ha-card";
import { LovelaceCardConfig } from "../../../data/lovelace";
@ -84,7 +84,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
this._setBaseUnit();
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -3,9 +3,9 @@ import {
LitElement,
PropertyValues,
PropertyDeclarations,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { classMap } from "lit-html/directives/classMap";
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
import { HomeAssistant } from "../../../types";
@ -114,7 +114,7 @@ export class HuiGlanceCard extends hassLocalizeLitMixin(LitElement)
return true;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, TemplateResult } from "lit-element";
import { computeCardSize } from "../common/compute-card-size";
import { HuiStackCard } from "./hui-stack-card";

View File

@ -1,11 +1,15 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../../../components/ha-card";
import { LovelaceCard, LovelaceCardEditor } from "../types";
import { LovelaceCardConfig } from "../../../data/lovelace";
import { TemplateResult } from "lit-html";
import { styleMap } from "lit-html/directives/styleMap";
import { styleMap } from "lit-html/directives/style-map";
export interface Config extends LovelaceCardConfig {
aspect_ratio?: string;
@ -42,7 +46,7 @@ export class HuiIframeCard extends LitElement implements LovelaceCard {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -3,11 +3,11 @@ import {
LitElement,
PropertyValues,
PropertyDeclarations,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import { fireEvent } from "../../../common/dom/fire_event";
import { styleMap } from "lit-html/directives/styleMap";
import { styleMap } from "lit-html/directives/style-map";
import { HomeAssistant, LightEntity } from "../../../types";
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
import { LovelaceCard, LovelaceCardEditor } from "../types";
@ -82,7 +82,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement)
this._config = { theme: "default", ...config };
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass || !this._config) {
return html``;
}

View File

@ -1,12 +1,16 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { classMap } from "lit-html/directives/classMap";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import "../../../components/ha-card";
import "../../../components/ha-markdown";
import { LovelaceCard, LovelaceCardEditor } from "../types";
import { LovelaceCardConfig } from "../../../data/lovelace";
import { TemplateResult } from "lit-html";
export interface Config extends LovelaceCardConfig {
content: string;
@ -42,7 +46,7 @@ export class HuiMarkdownCard extends LitElement implements LovelaceCard {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -1,12 +1,16 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../../../components/ha-card";
import { LovelaceCard, LovelaceCardEditor } from "../types";
import { LovelaceCardConfig, ActionConfig } from "../../../data/lovelace";
import { HomeAssistant } from "../../../types";
import { TemplateResult } from "lit-html";
import { classMap } from "lit-html/directives/classMap";
import { classMap } from "lit-html/directives/class-map";
import { handleClick } from "../common/handle-click";
import { longPress } from "../common/directives/long-press-directive";
@ -49,7 +53,7 @@ export class HuiPictureCard extends LitElement implements LovelaceCard {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import { createHuiElement } from "../common/create-hui-element";
@ -55,7 +54,7 @@ class HuiPictureElementsCard extends LitElement implements LovelaceCard {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -1,6 +1,10 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html/lib/shady-render";
import { classMap } from "lit-html/directives/classMap";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import "../../../components/ha-card";
import "../components/hui-image";
@ -65,7 +69,7 @@ class HuiPictureEntityCard extends hassLocalizeLitMixin(LitElement)
this._config = { show_name: true, show_state: true, ...config };
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,6 +1,10 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { classMap } from "lit-html/directives/classMap";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
import { DOMAINS_TOGGLE } from "../../../common/const";
@ -83,7 +87,7 @@ class HuiPictureGlanceCard extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -4,8 +4,8 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import "@polymer/paper-spinner/paper-spinner";
import { LovelaceCard, LovelaceCardEditor } from "../types";
@ -192,7 +192,7 @@ class HuiSensorCard extends LitElement implements LovelaceCard {
return 3;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,6 +1,5 @@
import { html, LitElement } from "@polymer/lit-element";
import { html, LitElement, TemplateResult } from "lit-element";
import { repeat } from "lit-html/directives/repeat";
import { TemplateResult } from "lit-html";
import { PaperInputElement } from "@polymer/paper-input/paper-input";
import "@polymer/paper-checkbox/paper-checkbox";
@ -79,7 +78,7 @@ class HuiShoppingListCard extends hassLocalizeLitMixin(LitElement)
}
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import { createCardElement } from "../common/create-card-element";
@ -50,7 +49,7 @@ export abstract class HuiStackCard extends LitElement implements LovelaceCard {
});
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -3,9 +3,9 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { classMap } from "lit-html/directives/classMap";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import "../../../components/ha-card";
import "../../../components/ha-icon";
@ -110,7 +110,7 @@ export class HuiThermostatCard extends hassLocalizeLitMixin(LitElement)
}
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass || !this._config) {
return html``;
}

View File

@ -1,8 +1,7 @@
import { html } from "@polymer/lit-element";
import { html, TemplateResult } from "lit-element";
import { computeCardSize } from "../common/compute-card-size";
import { HuiStackCard } from "./hui-stack-card";
import { TemplateResult } from "lit-html";
class HuiVerticalStackCard extends HuiStackCard {
public getCardSize() {

View File

@ -1,5 +1,5 @@
import { HomeAssistant } from "../../../types";
import { PropertyValues } from "@polymer/lit-element";
import { PropertyValues } from "lit-element";
// Check if config or Entity changed
export function hasConfigOrEntityChanged(

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-textarea";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
@ -51,7 +55,7 @@ export class HuiActionEditor extends LitElement {
return config.service || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass || !this.actions) {
return html``;
}

View File

@ -1,4 +1,4 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { html, LitElement, PropertyDeclarations } from "lit-element";
import "@polymer/paper-button/paper-button";
import "@polymer/paper-menu-button/paper-menu-button";
import "@polymer/paper-icon-button/paper-icon-button";

View File

@ -3,8 +3,8 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import { PaperToggleButtonElement } from "@polymer/paper-toggle-button/paper-toggle-button";
import { DOMAINS_TOGGLE } from "../../../common/const";
@ -35,7 +35,7 @@ class HuiEntitiesToggle extends LitElement {
}
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._toggleEntities) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { HomeAssistant } from "../../../types";
import { fireEvent } from "../../../common/dom/fire_event";
@ -19,7 +23,7 @@ export class HuiEntityEditor extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.entities) {
return html``;
}

View File

@ -1,6 +1,10 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-button/paper-button";
import { TemplateResult } from "lit-html";
import { HomeAssistant } from "../../../types";
import { fireEvent, HASSDomEvent } from "../../../common/dom/fire_event";
@ -28,7 +32,7 @@ export class HuiThemeSelectionEditor extends hassLocalizeLitMixin(LitElement) {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
const themes = ["Backend-selected", "default"].concat(
Object.keys(this.hass!.themes.themes).sort()
);

View File

@ -3,8 +3,8 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import { HomeAssistant } from "../../../types";
import format_date from "../../../common/datetime/format_date";
@ -49,7 +49,7 @@ class HuiTimestampDisplay extends hassLocalizeLitMixin(LitElement) {
this._clearInterval();
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.ts || !this.hass) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import "@polymer/paper-button/paper-button";
import { HomeAssistant } from "../../../../types";
@ -39,7 +38,7 @@ export class HuiCardPicker extends hassLocalizeLitMixin(LitElement) {
public hass?: HomeAssistant;
public cardPicked?: (cardConf: LovelaceCardConfig) => void;
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<h3>${this.localize("ui.panel.lovelace.editor.edit_card.pick_card")}</h3>

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { HomeAssistant } from "../../../../types";
import { HASSDomEvent } from "../../../../common/dom/fire_event";
@ -48,7 +52,7 @@ export class HuiDialogEditCard extends LitElement {
: undefined;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._params) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-dialog/paper-dialog";
import "@polymer/paper-item/paper-item";
// tslint:disable-next-line:no-duplicate-imports
@ -23,7 +27,7 @@ export class HuiDialogMoveCardView extends hassLocalizeLitMixin(LitElement) {
await this.updateComplete;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._params) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-dialog/paper-dialog";
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
@ -17,7 +21,7 @@ export class HuiDialogPickCard extends hassLocalizeLitMixin(LitElement) {
return {};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
<paper-dialog
with-backdrop

View File

@ -3,9 +3,9 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { classMap } from "lit-html/directives/classMap";
import { TemplateResult } from "lit-html";
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import yaml from "js-yaml";
import "@polymer/paper-spinner/paper-spinner";
@ -107,7 +107,7 @@ export class HuiEditCard extends hassLocalizeLitMixin(LitElement) {
this._loadConfigElement(this.cardConfig!);
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
let content;
let preview;
if (this._configElement !== undefined) {

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-textarea";
import { HomeAssistant } from "../../../../types";
@ -21,7 +25,7 @@ export class HuiYAMLEditor extends LitElement {
}
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<paper-textarea

View File

@ -1,4 +1,4 @@
import { html } from "@polymer/lit-element";
import { html } from "lit-element";
export const configElementStyle = html`
<style>

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
@ -49,7 +53,7 @@ export class HuiAlarmPanelCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.states || [];
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
@ -62,7 +66,7 @@ export class HuiEntitiesCardEditor extends hassLocalizeLitMixin(LitElement)
this._configEntities = processEditorEntities(config.entities);
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -68,7 +72,7 @@ export class HuiEntityButtonCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.theme || "default";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import "@polymer/paper-toggle-button/paper-toggle-button";
@ -70,7 +74,7 @@ export class HuiGaugeCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.severity || undefined;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
@ -68,7 +72,7 @@ export class HuiGlanceCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.columns || NaN;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -44,7 +48,7 @@ export class HuiIframeCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.aspect_ratio || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -47,7 +51,7 @@ export class HuiLightCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.entity || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -64,7 +68,7 @@ export class HuiMapCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.entities || [];
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import "@polymer/paper-input/paper-textarea";
@ -40,7 +44,7 @@ export class HuiMarkdownCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.content || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { struct } from "../../common/structs/struct";
import { EntitiesEditorEvent, EditorTarget } from "../types";
@ -34,7 +38,7 @@ export class HuiMediaControlCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.entity || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -51,7 +55,7 @@ export class HuiPictureCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.hold_action || { action: "none" };
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -42,7 +46,7 @@ export class HuiPlantStatusCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.name || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
@ -75,7 +79,7 @@ export class HuiSensorCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.hours_to_show || "24";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -33,7 +37,7 @@ export class HuiShoppingListEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.title || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { struct } from "../../common/structs/struct";
@ -47,7 +51,7 @@ export class HuiThermostatCardEditor extends hassLocalizeLitMixin(LitElement)
return this._config!.theme || "default";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { struct } from "../../common/structs/struct";
import { EntitiesEditorEvent, EditorTarget } from "../types";
@ -41,7 +45,7 @@ export class HuiWeatherForecastCardEditor
return this._config!.name || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-spinner/paper-spinner";
import "@polymer/paper-dialog/paper-dialog";
@ -41,7 +45,7 @@ export class HuiSaveConfig extends hassLocalizeLitMixin(LitElement) {
return this.shadowRoot!.querySelector("paper-dialog")!;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<paper-dialog with-backdrop>

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-spinner/paper-spinner";
import "@polymer/paper-dialog/paper-dialog";
// This is not a duplicate import, one is for types, one is for element.
@ -47,7 +51,7 @@ export class HuiDialogEditLovelace extends hassLocalizeLitMixin(LitElement) {
return this.shadowRoot!.querySelector("paper-dialog")!;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<paper-dialog with-backdrop>

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { EditorTarget } from "../types";
@ -33,7 +37,7 @@ export class HuiLovelaceEditor extends hassLocalizeLitMixin(LitElement) {
return this.config.title || "";
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${configElementStyle}
<div class="card-config">

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { HomeAssistant } from "../../../../types";
import { HASSDomEvent } from "../../../../common/dom/fire_event";
@ -34,7 +38,7 @@ export class HuiDialogEditView extends LitElement {
(this.shadowRoot!.children[0] as any).showDialog();
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._params) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-spinner/paper-spinner";
import "@polymer/paper-tabs/paper-tab";
@ -83,7 +87,7 @@ export class HuiEditView extends hassLocalizeLitMixin(LitElement) {
return this.shadowRoot!.querySelector("paper-dialog")!;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
let content;
switch (this._curTab) {
case "tab-settings":

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "@polymer/paper-input/paper-input";
import { EditorTarget } from "../types";
@ -59,7 +63,7 @@ export class HuiViewEditor extends hassLocalizeLitMixin(LitElement) {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass) {
return html``;
}

View File

@ -1,4 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { html, LitElement, TemplateResult } from "lit-element";
import "../../../components/ha-icon";
@ -8,7 +8,6 @@ import { longPress } from "../common/directives/long-press-directive";
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
import { LovelaceElement, LovelaceElementConfig } from "./types";
import { HomeAssistant } from "../../../types";
import { TemplateResult } from "lit-html";
interface Config extends LovelaceElementConfig {
icon: string;
@ -31,7 +30,7 @@ export class HuiIconElement extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -1,4 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { html, LitElement, TemplateResult } from "lit-element";
import "../components/hui-image";
@ -8,7 +8,6 @@ import { longPress } from "../common/directives/long-press-directive";
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
import { LovelaceElement, LovelaceElementConfig } from "./types";
import { HomeAssistant } from "../../../types";
import { TemplateResult } from "lit-html";
interface Config extends LovelaceElementConfig {
image?: string;
@ -40,7 +39,7 @@ export class HuiImageElement extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import "../../../components/buttons/ha-call-service-button";
@ -37,7 +36,7 @@ export class HuiServiceButtonElement extends LitElement
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -1,11 +1,10 @@
import { html, LitElement } from "@polymer/lit-element";
import { html, LitElement, TemplateResult } from "lit-element";
import "../../../components/entity/ha-state-label-badge";
import computeStateName from "../../../common/entity/compute_state_name";
import { LovelaceElement, LovelaceElementConfig } from "./types";
import { HomeAssistant } from "../../../types";
import { TemplateResult } from "lit-html";
export class HuiStateBadgeElement extends LitElement
implements LovelaceElement {
@ -24,7 +23,7 @@ export class HuiStateBadgeElement extends LitElement
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (
!this._config ||
!this.hass ||

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import "../../../components/entity/state-badge";
@ -27,7 +26,7 @@ export class HuiStateIconElement extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (
!this._config ||
!this.hass ||

View File

@ -1,4 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { html, LitElement, TemplateResult } from "lit-element";
import "../../../components/entity/ha-state-label-badge";
@ -9,7 +9,6 @@ import { longPress } from "../common/directives/long-press-directive";
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
import { LovelaceElement, LovelaceElementConfig } from "./types";
import { HomeAssistant } from "../../../types";
import { TemplateResult } from "lit-html";
interface Config extends LovelaceElementConfig {
prefix?: string;
@ -33,7 +32,7 @@ class HuiStateLabelElement extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import "../../../components/ha-climate-state";
import "../components/hui-generic-entity-row";
@ -26,7 +25,7 @@ class HuiClimateEntityRow extends LitElement implements EntityRow {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass || !this._config) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "../../../components/ha-cover-controls";
@ -28,7 +32,7 @@ class HuiCoverEntityRow extends LitElement implements EntityRow {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
class HuiErrorEntityRow extends LitElement {
public entity?: string;
@ -12,7 +11,7 @@ class HuiErrorEntityRow extends LitElement {
};
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()} ${this.error || "Entity not available"}:
${this.entity || ""}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "../../../components/entity/ha-entity-toggle";
@ -30,7 +34,7 @@ class HuiGroupEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,6 +1,10 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { repeat } from "lit-html/directives/repeat";
import { TemplateResult } from "lit-html";
import "@polymer/paper-dropdown-menu/paper-dropdown-menu";
import "@polymer/paper-item/paper-item";
import "@polymer/paper-listbox/paper-listbox";
@ -32,7 +36,7 @@ class HuiInputSelectEntityRow extends LitElement implements EntityRow {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass || !this._config) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import { PaperInputElement } from "@polymer/paper-input/paper-input";
import "../components/hui-generic-entity-row";
@ -27,7 +31,7 @@ class HuiInputTextEntityRow extends LitElement implements EntityRow {
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "./hui-error-entity-row";
@ -27,7 +31,7 @@ class HuiLockEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,4 @@
import { html, LitElement } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { html, LitElement, TemplateResult } from "lit-element";
import "@polymer/paper-icon-button/paper-icon-button";
import "../components/hui-generic-entity-row";
@ -36,7 +35,7 @@ class HuiMediaPlayerEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this.hass || !this._config) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "../../../components/entity/ha-entity-toggle";
@ -28,7 +32,7 @@ class HuiSceneEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "../../../components/entity/ha-entity-toggle";
@ -28,7 +32,7 @@ class HuiScriptEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "../components/hui-timestamp-display";
@ -34,7 +38,7 @@ class HuiSensorEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "./hui-error-entity-row";
@ -28,7 +32,7 @@ class HuiTextEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -1,5 +1,9 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "../components/hui-generic-entity-row";
import "../../../components/entity/ha-entity-toggle";
@ -29,7 +33,7 @@ class HuiToggleEntityRow extends hassLocalizeLitMixin(LitElement)
this._config = config;
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this.hass) {
return html``;
}

View File

@ -6,9 +6,8 @@ import "../../layouts/hass-error-screen";
import "./hui-root";
import { HomeAssistant, PanelInfo } from "../../types";
import { Lovelace } from "./types";
import { LitElement, html, PropertyValues } from "@polymer/lit-element";
import { LitElement, html, PropertyValues, TemplateResult } from "lit-element";
import { hassLocalizeLitMixin } from "../../mixins/lit-localize-mixin";
import { TemplateResult } from "lit-html";
import { showSaveDialog } from "./editor/show-save-config-dialog";
import { generateLovelaceConfig } from "./common/generate-lovelace-config";
@ -49,7 +48,7 @@ class LovelacePanel extends hassLocalizeLitMixin(LitElement) {
this._closeEditor = this._closeEditor.bind(this);
}
public render(): TemplateResult {
public render(): TemplateResult | void {
const state = this._state!;
if (state === "loaded") {

View File

@ -1,6 +1,5 @@
import { LitElement, html } from "@polymer/lit-element";
import { classMap } from "lit-html/directives/classMap";
import { TemplateResult } from "lit-html";
import { LitElement, html, TemplateResult } from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import yaml from "js-yaml";
import "@polymer/app-layout/app-header-layout/app-header-layout";
@ -43,7 +42,7 @@ class LovelaceFullConfigEditor extends hassLocalizeLitMixin(LitElement) {
};
}
public render(): TemplateResult {
public render(): TemplateResult | void {
return html`
${this.renderStyle()}
<app-header-layout>

View File

@ -3,9 +3,9 @@ import {
LitElement,
PropertyDeclarations,
PropertyValues,
} from "@polymer/lit-element";
import { TemplateResult } from "lit-html";
import { classMap } from "lit-html/directives/classMap";
TemplateResult,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import "@polymer/app-layout/app-header-layout/app-header-layout";
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-scroll-effects/effects/waterfall";
@ -119,7 +119,7 @@ class HUIRoot extends hassLocalizeLitMixin(LitElement) {
}
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<app-route .route="${this.route}" pattern="/:view" data="${

View File

@ -1,11 +1,15 @@
import { html, LitElement, PropertyDeclarations } from "@polymer/lit-element";
import {
html,
LitElement,
PropertyDeclarations,
TemplateResult,
} from "lit-element";
import "./cards/hui-entities-card";
import { computeUnusedEntities } from "./common/compute-unused-entities";
import { createCardElement } from "./common/create-card-element";
import { HomeAssistant } from "../../types";
import { TemplateResult } from "lit-html";
import { LovelaceCard } from "./types";
import { LovelaceConfig } from "../../data/lovelace";
@ -35,7 +39,7 @@ export class HuiUnusedEntities extends LitElement {
this._createElement();
}
protected render(): TemplateResult {
protected render(): TemplateResult | void {
if (!this._config || !this._hass) {
return html``;
}

Some files were not shown because too many files have changed in this diff Show More