Render should always return a html template (#4612)

This commit is contained in:
Bram Kragten 2020-01-27 17:34:22 +01:00 committed by Paulus Schoutsen
parent 82fb622904
commit 04f8f0f74f
237 changed files with 248 additions and 245 deletions

View File

@ -39,7 +39,7 @@ class HcCast extends LitElement {
@property() private askWrite = false; @property() private askWrite = false;
@property() private lovelaceConfig?: LovelaceConfig | null; @property() private lovelaceConfig?: LovelaceConfig | null;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (this.lovelaceConfig === undefined) { if (this.lovelaceConfig === undefined) {
return html` return html`
<loading-screen></loading-screen>> <loading-screen></loading-screen>>

View File

@ -70,7 +70,7 @@ export class HcConnect extends LitElement {
@property() private castManager?: CastManager | null; @property() private castManager?: CastManager | null;
private openDemo = false; private openDemo = false;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (this.cannotConnect) { if (this.cannotConnect) {
const tokens = loadTokens(); const tokens = loadTokens();
return html` return html`

View File

@ -22,7 +22,7 @@ class HcLayout extends LitElement {
@property() public connection?: Connection; @property() public connection?: Connection;
@property() public user?: HassUser; @property() public user?: HassUser;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<ha-card> <ha-card>
<div class="layout"> <div class="layout">

View File

@ -16,7 +16,7 @@ class HcDemo extends HassElement {
@property() public lovelacePath!: string; @property() public lovelacePath!: string;
@property() private _lovelaceConfig?: LovelaceConfig; @property() private _lovelaceConfig?: LovelaceConfig;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._lovelaceConfig) { if (!this._lovelaceConfig) {
return html``; return html``;
} }

View File

@ -14,7 +14,7 @@ class HcLaunchScreen extends LitElement {
@property() public hass?: HomeAssistant; @property() public hass?: HomeAssistant;
@property() public error?: string; @property() public error?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="container"> <div class="container">
<img <img

View File

@ -22,7 +22,7 @@ class HcLovelace extends LitElement {
@property() public viewPath?: string | number; @property() public viewPath?: string | number;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const index = this._viewIndex; const index = this._viewIndex;
if (index === undefined) { if (index === undefined) {
return html` return html`

View File

@ -50,7 +50,7 @@ export class HcMain extends HassElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (this._showDemo) { if (this._showDemo) {
return html` return html`
<hc-demo .lovelacePath=${this._lovelacePath}></hc-demo> <hc-demo .lovelacePath=${this._lovelacePath}></hc-demo>

View File

@ -27,7 +27,7 @@ class CastDemoRow extends LitElement implements LovelaceRow {
// No config possible. // No config possible.
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if ( if (
!this._castManager || !this._castManager ||
this._castManager.castState === "NO_DEVICES_AVAILABLE" this._castManager.castState === "NO_DEVICES_AVAILABLE"

View File

@ -6,7 +6,7 @@ import { actionHandler } from "../../../src/panels/lovelace/common/directives/ac
import { ActionHandlerEvent } from "../../../src/data/lovelace"; import { ActionHandlerEvent } from "../../../src/data/lovelace";
export class DemoUtilLongPress extends LitElement { export class DemoUtilLongPress extends LitElement {
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
${this.renderStyle()} ${this.renderStyle()}
${[1, 2, 3].map( ${[1, 2, 3].map(

View File

@ -36,7 +36,7 @@ class HassioAddonRepositoryEl extends LitElement {
} }
); );
protected render(): TemplateResult | void { protected render(): TemplateResult {
const repo = this.repo; const repo = this.repo;
const addons = this._getAddons(this.addons, this.filter); const addons = this._getAddons(this.addons, this.filter);

View File

@ -48,7 +48,7 @@ class HassioAddonStore extends LitElement {
await this._loadData(); await this._loadData();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._addons || !this._repos) { if (!this._addons || !this._repos) {
return html` return html`
<loading-screen></loading-screen> <loading-screen></loading-screen>

View File

@ -33,7 +33,7 @@ class HassioRepositoriesEditor extends LitElement {
.sort((a, b) => (a.name < b.name ? -1 : 1)) .sort((a, b) => (a.name < b.name ? -1 : 1))
); );
protected render(): TemplateResult | void { protected render(): TemplateResult {
const repos = this._sortedRepos(this.repos); const repos = this._sortedRepos(this.repos);
return html` return html`
<div class="card-group"> <div class="card-group">

View File

@ -39,7 +39,7 @@ class HassioAddonAudio extends LitElement {
@property() private _selectedInput!: null | string; @property() private _selectedInput!: null | string;
@property() private _selectedOutput!: null | string; @property() private _selectedOutput!: null | string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<paper-card heading="Audio"> <paper-card heading="Audio">
<div class="card-content"> <div class="card-content">

View File

@ -31,7 +31,7 @@ class HassioAddonConfig extends LitElement {
@property() private _config!: string; @property() private _config!: string;
@property({ type: Boolean }) private _configHasChanged = false; @property({ type: Boolean }) private _configHasChanged = false;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<paper-card heading="Config"> <paper-card heading="Config">
<div class="card-content"> <div class="card-content">

View File

@ -95,7 +95,7 @@ class HassioAddonInfo extends LitElement {
@property() public addon!: HassioAddonDetails; @property() public addon!: HassioAddonDetails;
@property() private _error?: string; @property() private _error?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
${ ${
this._computeUpdateAvailable this._computeUpdateAvailable

View File

@ -31,7 +31,7 @@ class HassioAddonLogs extends LitElement {
await this._loadData(); await this._loadData();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<paper-card heading="Log"> <paper-card heading="Log">
${this._error ${this._error

View File

@ -44,7 +44,7 @@ class HassioAddonNetwork extends LitElement {
this._setNetworkConfig(); this._setNetworkConfig();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._config) { if (!this._config) {
return html``; return html``;
} }

View File

@ -33,7 +33,7 @@ class HassioAddonView extends LitElement {
@property() public route!: Route; @property() public route!: Route;
@property() public addon?: HassioAddonDetails; @property() public addon?: HassioAddonDetails;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.addon) { if (!this.addon) {
return html` return html`
<paper-spinner-lite active></paper-spinner-lite> <paper-spinner-lite active></paper-spinner-lite>

View File

@ -23,7 +23,7 @@ class HassioCardContent extends LitElement {
@property() public iconClass?: string; @property() public iconClass?: string;
@property() public icon = "hass:help-circle"; @property() public icon = "hass:help-circle";
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<iron-icon <iron-icon
class=${this.iconClass} class=${this.iconClass}

View File

@ -16,7 +16,7 @@ import "@material/mwc-button";
class HassioSearchInput extends LitElement { class HassioSearchInput extends LitElement {
@property() private filter?: string; @property() private filter?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="search-container"> <div class="search-container">
<paper-input <paper-input

View File

@ -21,7 +21,7 @@ class HassioAddons extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@property() public addons?: HassioAddonInfo[]; @property() public addons?: HassioAddonInfo[];
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="content card-group"> <div class="content card-group">
<div class="title">Add-ons</div> <div class="title">Add-ons</div>

View File

@ -24,7 +24,7 @@ class HassioDashboard extends LitElement {
@property() public hassInfo!: HassioHomeAssistantInfo; @property() public hassInfo!: HassioHomeAssistantInfo;
@property() public hassOsInfo!: HassioHassOSInfo; @property() public hassOsInfo!: HassioHassOSInfo;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="content"> <div class="content">
<hassio-update <hassio-update

View File

@ -32,7 +32,7 @@ export class HassioUpdate extends LitElement {
@property() public supervisorInfo: HassioSupervisorInfo; @property() public supervisorInfo: HassioSupervisorInfo;
@property() private _error?: string; @property() private _error?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const updatesAvailable: number = [ const updatesAvailable: number = [
this.hassInfo, this.hassInfo,
this.supervisorInfo, this.supervisorInfo,

View File

@ -32,7 +32,7 @@ class HassioMarkdownDialog extends LitElement {
this._dialog.open(); this._dialog.open();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<ha-paper-dialog id="dialog" with-backdrop=""> <ha-paper-dialog id="dialog" with-backdrop="">
<app-toolbar> <app-toolbar>

View File

@ -102,7 +102,7 @@ class HassioSnapshotDialog extends LitElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.snapshot) { if (!this.snapshot) {
return html``; return html``;
} }

View File

@ -41,7 +41,7 @@ class HassioPagesWithTabs extends LitElement {
@property() public hassInfo!: HassioHomeAssistantInfo; @property() public hassInfo!: HassioHomeAssistantInfo;
@property() public hassOsInfo!: HassioHassOSInfo; @property() public hassOsInfo!: HassioHassOSInfo;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const page = this._page; const page = this._page;
return html` return html`
<app-header-layout has-scrolling-region> <app-header-layout has-scrolling-region>

View File

@ -23,7 +23,7 @@ class HassioIngressView extends LitElement {
@property() public route!: Route; @property() public route!: Route;
@property() private _addon?: HassioAddonDetails; @property() private _addon?: HassioAddonDetails;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._addon) { if (!this._addon) {
return html` return html`
<hass-loading-screen></hass-loading-screen> <hass-loading-screen></hass-loading-screen>

View File

@ -76,7 +76,7 @@ class HassioSnapshots extends LitElement {
await this._updateSnapshots(); await this._updateSnapshots();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="content"> <div class="content">
<div class="card-group"> <div class="card-group">

View File

@ -12,7 +12,7 @@ class HaBadgesCard extends LitElement {
@property() public hass?: HomeAssistant; @property() public hass?: HomeAssistant;
@property() public states?: HassEntity[]; @property() public states?: HassEntity[];
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.states) { if (!this.hass || !this.states) {
return html``; return html``;
} }

View File

@ -20,7 +20,7 @@ class SearchInput extends LitElement {
this.shadowRoot!.querySelector("paper-input")!.focus(); this.shadowRoot!.querySelector("paper-input")!.focus();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="search-container"> <div class="search-container">
<paper-input <paper-input

View File

@ -255,9 +255,9 @@ export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._devices || !this._areas || !this._entities) { if (!this._devices || !this._areas || !this._entities) {
return; return html``;
} }
const areas = this._getDevices( const areas = this._getDevices(
this._devices, this._devices,

View File

@ -83,7 +83,7 @@ export abstract class HaDeviceAutomationPicker<
return `${this._automations[idx].device_id}_${idx}`; return `${this._automations[idx].device_id}_${idx}`;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (this._renderEmpty) { if (this._renderEmpty) {
return html``; return html``;
} }

View File

@ -203,9 +203,9 @@ export class HaDevicePicker extends SubscribeMixin(LitElement) {
]; ];
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.devices || !this.areas || !this.entities) { if (!this.devices || !this.areas || !this.entities) {
return; return html``;
} }
const devices = this._getDevices( const devices = this._getDevices(
this.devices, this.devices,

View File

@ -37,9 +37,9 @@ class HaDevicesPicker extends LitElement {
public pickedDeviceLabel?: string; public pickedDeviceLabel?: string;
@property({ attribute: "pick-device-label" }) public pickDeviceLabel?: string; @property({ attribute: "pick-device-label" }) public pickDeviceLabel?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass) { if (!this.hass) {
return; return html``;
} }
const currentDevices = this._currentDevices; const currentDevices = this._currentDevices;

View File

@ -40,9 +40,9 @@ class HaEntitiesPickerLight extends LitElement {
public pickedEntityLabel?: string; public pickedEntityLabel?: string;
@property({ attribute: "pick-entity-label" }) public pickEntityLabel?: string; @property({ attribute: "pick-entity-label" }) public pickEntityLabel?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass) { if (!this.hass) {
return; return html``;
} }
const currentEntities = this._currentEntities; const currentEntities = this._currentEntities;

View File

@ -145,7 +145,7 @@ class HaEntityPicker extends LitElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
const states = this._getStates( const states = this._getStates(
this._hass, this._hass,
this.includeDomains, this.includeDomains,

View File

@ -28,7 +28,7 @@ class HaEntityToggle extends LitElement {
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
@property() private _isOn: boolean = false; @property() private _isOn: boolean = false;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.stateObj) { if (!this.stateObj) {
return html` return html`
<ha-switch disabled></ha-switch> <ha-switch disabled></ha-switch>

View File

@ -52,7 +52,7 @@ export class HaStateLabelBadge extends LitElement {
this.clearInterval(); this.clearInterval();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
const state = this.state; const state = this.state;
if (!state) { if (!state) {

View File

@ -28,7 +28,7 @@ export class StateBadge extends LitElement {
@property({ type: Boolean }) public stateColor?: boolean; @property({ type: Boolean }) public stateColor?: boolean;
@query("ha-icon") private _icon!: HaIcon; @query("ha-icon") private _icon!: HaIcon;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const stateObj = this.stateObj; const stateObj = this.stateObj;
if (!stateObj) { if (!stateObj) {

View File

@ -85,9 +85,9 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) {
]; ];
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._areas) { if (!this._areas) {
return; return html``;
} }
return html` return html`
<vaadin-combo-box-light <vaadin-combo-box-light

View File

@ -16,7 +16,7 @@ class HaAttributes extends LitElement {
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
@property() public extraFilters?: string; @property() public extraFilters?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.stateObj) { if (!this.stateObj) {
return html``; return html``;
} }

View File

@ -42,7 +42,7 @@ class HaCameraStream extends LitElement {
this._attached = false; this._attached = false;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.stateObj || !this._attached) { if (!this.stateObj || !this._attached) {
return html``; return html``;
} }

View File

@ -23,7 +23,7 @@ export class HaFormTimePeriod extends LitElement implements HaFormElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<paper-time-input <paper-time-input
.label=${this.label} .label=${this.label}

View File

@ -17,7 +17,7 @@ class HaLabelBadge extends LitElement {
@property() public description?: string; @property() public description?: string;
@property() public image?: string; @property() public image?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="badge-container"> <div class="badge-container">
<div class="label-badge" id="badge"> <div class="label-badge" id="badge">

View File

@ -42,7 +42,7 @@ class HaMenuButton extends LitElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
const hasNotifications = const hasNotifications =
(this.narrow || this.hass.dockedSidebar === "always_hidden") && (this.narrow || this.hass.dockedSidebar === "always_hidden") &&
(this._hasNotifications || (this._hasNotifications ||

View File

@ -64,7 +64,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._related) { if (!this._related) {
return html``; return html``;
} }

View File

@ -50,7 +50,7 @@ class LocationEditor extends LitElement {
this._ignoreFitToMap = this.location; this._ignoreFitToMap = this.location;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div id="map"></div> <div id="map"></div>
`; `;

View File

@ -90,7 +90,7 @@ export class HaLocationsEditor extends LitElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div id="map"></div> <div id="map"></div>
`; `;

View File

@ -31,7 +31,7 @@ const computeInitials = (name: string) => {
class StateBadge extends LitElement { class StateBadge extends LitElement {
@property() public user?: User | CurrentUser; @property() public user?: User | CurrentUser;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const user = this.user; const user = this.user;
const initials = user ? computeInitials(user.name) : "?"; const initials = user ? computeInitials(user.name) : "?";
return html` return html`

View File

@ -34,7 +34,7 @@ class HaUserPicker extends LitElement {
.sort((a, b) => compare(a.name, b.name)); .sort((a, b) => compare(a.name, b.name));
}); });
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<paper-dropdown-menu-light .label=${this.label}> <paper-dropdown-menu-light .label=${this.label}>
<paper-listbox <paper-listbox

View File

@ -48,7 +48,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
await this.updateComplete; await this.updateComplete;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params) { if (!this._params) {
return html``; return html``;
} }

View File

@ -116,7 +116,7 @@ class DataEntryFlowDialog extends LitElement {
this._scheduleCenterDialog(); this._scheduleCenterDialog();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params) { if (!this._params) {
return html``; return html``;
} }

View File

@ -24,7 +24,7 @@ class StepFlowAbort extends LitElement {
@property() @property()
private step!: DataEntryFlowStepAbort; private step!: DataEntryFlowStepAbort;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<h2> <h2>
${this.hass.localize( ${this.hass.localize(

View File

@ -36,7 +36,7 @@ class StepFlowCreateEntry extends LitElement {
@property() @property()
public devices!: DeviceRegistryEntry[]; public devices!: DeviceRegistryEntry[];
protected render(): TemplateResult | void { protected render(): TemplateResult {
const localize = this.hass.localize; const localize = this.hass.localize;
return html` return html`

View File

@ -28,7 +28,7 @@ class StepFlowExternal extends LitElement {
@property() @property()
private step!: DataEntryFlowStepExternal; private step!: DataEntryFlowStepExternal;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const localize = this.hass.localize; const localize = this.hass.localize;
return html` return html`

View File

@ -40,7 +40,7 @@ class StepFlowForm extends LitElement {
@property() @property()
private _errorMsg?: string; private _errorMsg?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const step = this.step; const step = this.step;
const stepData = this._stepDataProcessed; const stepData = this._stepDataProcessed;

View File

@ -10,7 +10,7 @@ import "@polymer/paper-spinner/paper-spinner-lite";
@customElement("step-flow-loading") @customElement("step-flow-loading")
class StepFlowLoading extends LitElement { class StepFlowLoading extends LitElement {
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="init-spinner"> <div class="init-spinner">
<paper-spinner-lite active></paper-spinner-lite> <paper-spinner-lite active></paper-spinner-lite>

View File

@ -59,7 +59,7 @@ class StepFlowPickHandler extends LitElement {
); );
}); });
protected render(): TemplateResult | void { protected render(): TemplateResult {
const handlers = this._getHandlers(this.handlers, this.filter); const handlers = this._getHandlers(this.handlers, this.filter);
return html` return html`

View File

@ -44,7 +44,7 @@ class DialogDeviceRegistryDetail extends LitElement {
await this.updateComplete; await this.updateComplete;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params) { if (!this._params) {
return html``; return html``;
} }

View File

@ -22,7 +22,7 @@ class DomainTogglerDialog extends LitElement {
this._params = params; this._params = params;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params) { if (!this._params) {
return html``; return html``;
} }

View File

@ -32,7 +32,7 @@ class DialogBox extends LitElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params) { if (!this._params) {
return html``; return html``;
} }

View File

@ -19,7 +19,7 @@ class MoreInfoAutomation extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.stateObj) { if (!this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -38,7 +38,7 @@ class MoreInfoCamera extends LitElement {
this._attached = false; this._attached = false;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._attached || !this.hass || !this.stateObj) { if (!this._attached || !this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -39,7 +39,7 @@ class MoreInfoClimate extends LitElement {
@property() public stateObj?: ClimateEntity; @property() public stateObj?: ClimateEntity;
private _resizeDebounce?: number; private _resizeDebounce?: number;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.stateObj) { if (!this.stateObj) {
return html``; return html``;
} }

View File

@ -17,7 +17,7 @@ class MoreInfoCounter extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.stateObj) { if (!this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -16,7 +16,7 @@ class MoreInfoDefault extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.stateObj) { if (!this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -16,7 +16,7 @@ class MoreInfoScript extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.stateObj) { if (!this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -19,7 +19,7 @@ class MoreInfoSun extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@property() public stateObj?: HassEntity; @property() public stateObj?: HassEntity;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.stateObj) { if (!this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -19,7 +19,7 @@ class MoreInfoTimer extends LitElement {
@property() public stateObj?: TimerEntity; @property() public stateObj?: TimerEntity;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.stateObj) { if (!this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -72,7 +72,7 @@ class MoreInfoWeather extends LitElement {
return false; return false;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.stateObj) { if (!this.hass || !this.stateObj) {
return html``; return html``;
} }

View File

@ -19,7 +19,7 @@ export class HuiConfiguratorNotificationItem extends LitElement {
@property() public notification?: PersitentNotificationEntity; @property() public notification?: PersitentNotificationEntity;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.notification) { if (!this.hass || !this.notification) {
return html``; return html``;
} }

View File

@ -11,7 +11,7 @@ import "../../components/ha-card";
@customElement("notification-item-template") @customElement("notification-item-template")
export class HuiNotificationItemTemplate extends LitElement { export class HuiNotificationItemTemplate extends LitElement {
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<ha-card> <ha-card>
<div class="header"><slot name="header"></slot></div> <div class="header"><slot name="header"></slot></div>

View File

@ -28,7 +28,7 @@ export class HuiNotificationItem extends LitElement {
return false; return false;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.notification) { if (!this.hass || !this.notification) {
return html``; return html``;
} }

View File

@ -23,7 +23,7 @@ export class HuiPersistentNotificationItem extends LitElement {
@property() public notification?: PersistentNotification; @property() public notification?: PersistentNotification;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || !this.notification) { if (!this.hass || !this.notification) {
return html``; return html``;
} }

View File

@ -34,7 +34,7 @@ class DialogZHADeviceInfo extends LitElement {
this._dialog.open(); this._dialog.open();
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params || !this._device) { if (!this._params || !this._device) {
return html``; return html``;
} }

View File

@ -15,7 +15,7 @@ class HassErrorScreen extends LitElement {
@property() @property()
public error?: string; public error?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<hass-subpage> <hass-subpage>
<div class="content"> <div class="content">

View File

@ -20,7 +20,7 @@ class HassLoadingScreen extends LitElement {
@property() public hass?: HomeAssistant; @property() public hass?: HomeAssistant;
@property() public narrow?: boolean; @property() public narrow?: boolean;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<app-toolbar> <app-toolbar>
${this.rootnav ${this.rootnav

View File

@ -20,7 +20,7 @@ class HassSubpage extends LitElement {
@property({ type: Boolean }) @property({ type: Boolean })
public hassio = false; public hassio = false;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="toolbar"> <div class="toolbar">
<ha-paper-icon-button-arrow-prev <ha-paper-icon-button-arrow-prev

View File

@ -38,11 +38,11 @@ class HomeAssistantMain extends LitElement {
@property() public route?: Route; @property() public route?: Route;
@property({ type: Boolean }) private narrow?: boolean; @property({ type: Boolean }) private narrow?: boolean;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const hass = this.hass; const hass = this.hass;
if (!hass) { if (!hass) {
return; return html``;
} }
const sidebarNarrow = this._sidebarNarrow; const sidebarNarrow = this._sidebarNarrow;

View File

@ -10,7 +10,7 @@ import {
@customElement("loading-screen") @customElement("loading-screen")
class LoadingScreen extends LitElement { class LoadingScreen extends LitElement {
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<paper-spinner-lite active></paper-spinner-lite> <paper-spinner-lite active></paper-spinner-lite>
`; `;

View File

@ -58,7 +58,7 @@ class NotificationManager extends LitElement {
}); });
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<ha-toast .noCancelOnOutsideClick=${this._noCancelOnOutsideClick}> <ha-toast .noCancelOnOutsideClick=${this._noCancelOnOutsideClick}>
${this._action ${this._action

View File

@ -50,7 +50,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
@property() private _loading = false; @property() private _loading = false;
@property() private _steps?: OnboardingStep[]; @property() private _steps?: OnboardingStep[];
protected render(): TemplateResult | void { protected render(): TemplateResult {
const step = this._curStep()!; const step = this._curStep()!;
if (this._loading || !step) { if (this._loading || !step) {
@ -79,6 +79,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
></onboarding-integrations> ></onboarding-integrations>
`; `;
} }
return html``;
} }
protected firstUpdated(changedProps: PropertyValues) { protected firstUpdated(changedProps: PropertyValues) {

View File

@ -16,7 +16,7 @@ class IntegrationBadge extends LitElement {
@property() public badgeIcon?: string; @property() public badgeIcon?: string;
@property({ type: Boolean, reflect: true }) public clickable = false; @property({ type: Boolean, reflect: true }) public clickable = false;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="icon"> <div class="icon">
<iron-icon .icon=${this.icon}></iron-icon> <iron-icon .icon=${this.icon}></iron-icon>

View File

@ -41,7 +41,7 @@ class OnboardingCoreConfig extends LitElement {
@property() private _unitSystem!: ConfigUpdateValues["unit_system"]; @property() private _unitSystem!: ConfigUpdateValues["unit_system"];
@property() private _timeZone!: string; @property() private _timeZone!: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<p> <p>
${this.onboardingLocalize( ${this.onboardingLocalize(

View File

@ -28,7 +28,7 @@ class OnboardingCreateUser extends LitElement {
@property() private _loading = false; @property() private _loading = false;
@property() private _errorMsg?: string = undefined; @property() private _errorMsg?: string = undefined;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<p> <p>
${this.localize("ui.panel.page-onboarding.intro")} ${this.localize("ui.panel.page-onboarding.intro")}

View File

@ -51,7 +51,7 @@ class OnboardingIntegrations extends LitElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._entries || !this._discovered) { if (!this._entries || !this._discovered) {
return html``; return html``;
} }

View File

@ -9,7 +9,7 @@ import {
@customElement("onboarding-loading") @customElement("onboarding-loading")
class OnboardingLoading extends LitElement { class OnboardingLoading extends LitElement {
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<div class="loader"></div> <div class="loader"></div>
`; `;

View File

@ -32,7 +32,7 @@ class DialogAreaDetail extends LitElement {
await this.updateComplete; await this.updateComplete;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params) { if (!this._params) {
return html``; return html``;
} }

View File

@ -45,7 +45,7 @@ export class HaConfigAreas extends LitElement {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.hass || this._areas === undefined) { if (!this.hass || this._areas === undefined) {
return html` return html`
<hass-loading-screen></hass-loading-screen> <hass-loading-screen></hass-loading-screen>

View File

@ -45,7 +45,7 @@ export class HaAutomationEditor extends LitElement {
@property() private _dirty?: boolean; @property() private _dirty?: boolean;
@property() private _errors?: string; @property() private _errors?: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<ha-app-layout has-scrolling-region> <ha-app-layout has-scrolling-region>
<app-header slot="header" fixed> <app-header slot="header" fixed>

View File

@ -39,7 +39,7 @@ class HaAutomationPicker extends LitElement {
@property() public isWide!: boolean; @property() public isWide!: boolean;
@property() public automations!: AutomationEntity[]; @property() public automations!: AutomationEntity[];
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<hass-subpage <hass-subpage
.showBackButton=${!this.isWide} .showBackButton=${!this.isWide}

View File

@ -58,7 +58,7 @@ class DialogThingtalk extends LitElement {
this._opened = true; this._opened = true;
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this._params) { if (!this._params) {
return html``; return html``;
} }

View File

@ -112,7 +112,7 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
} }
} }
protected render(): TemplateResult | void { protected render(): TemplateResult {
return html` return html`
<ha-paper-dialog <ha-paper-dialog
modal modal

View File

@ -23,7 +23,7 @@ export class CloudAlexaPref extends LitElement {
@property() public cloudStatus?: CloudStatusLoggedIn; @property() public cloudStatus?: CloudStatusLoggedIn;
@property() private _syncing = false; @property() private _syncing = false;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.cloudStatus) { if (!this.cloudStatus) {
return html``; return html``;
} }

View File

@ -24,7 +24,7 @@ export class CloudGooglePref extends LitElement {
@property() public hass?: HomeAssistant; @property() public hass?: HomeAssistant;
@property() public cloudStatus?: CloudStatusLoggedIn; @property() public cloudStatus?: CloudStatusLoggedIn;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.cloudStatus) { if (!this.cloudStatus) {
return html``; return html``;
} }

View File

@ -29,7 +29,7 @@ export class CloudRemotePref extends LitElement {
@property() public hass?: HomeAssistant; @property() public hass?: HomeAssistant;
@property() public cloudStatus?: CloudStatusLoggedIn; @property() public cloudStatus?: CloudStatusLoggedIn;
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (!this.cloudStatus) { if (!this.cloudStatus) {
return html``; return html``;
} }

View File

@ -72,7 +72,7 @@ class CloudAlexa extends LitElement {
) )
); );
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (this._entities === undefined) { if (this._entities === undefined) {
return html` return html`
<hass-loading-screen></hass-loading-screen> <hass-loading-screen></hass-loading-screen>

View File

@ -71,7 +71,7 @@ class CloudGoogleAssistant extends LitElement {
) )
); );
protected render(): TemplateResult | void { protected render(): TemplateResult {
if (this._entities === undefined) { if (this._entities === undefined) {
return html` return html`
<hass-loading-screen></hass-loading-screen> <hass-loading-screen></hass-loading-screen>

View File

@ -33,7 +33,7 @@ class ConfigCoreForm extends LitElement {
@property() private _unitSystem!: ConfigUpdateValues["unit_system"]; @property() private _unitSystem!: ConfigUpdateValues["unit_system"];
@property() private _timeZone!: string; @property() private _timeZone!: string;
protected render(): TemplateResult | void { protected render(): TemplateResult {
const canEdit = ["storage", "default"].includes( const canEdit = ["storage", "default"].includes(
this.hass.config.config_source this.hass.config.config_source
); );

View File

@ -24,7 +24,7 @@ class ConfigNameForm extends LitElement {
@property() private _name!: ConfigUpdateValues["location_name"]; @property() private _name!: ConfigUpdateValues["location_name"];
protected render(): TemplateResult | void { protected render(): TemplateResult {
const canEdit = ["storage", "default"].includes( const canEdit = ["storage", "default"].includes(
this.hass.config.config_source this.hass.config.config_source
); );

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