Update dependency prettier to v3 (#17215)

* Update dependency prettier to v3

* Update config and remove .prettierignore

* Reformat

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Steve Repsher <steverep@users.noreply.github.com>
pull/17312/head
renovate[bot] 2023-07-14 17:40:17 +00:00 committed by GitHub
parent 9bf76a07b8
commit cb0bc762b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
127 changed files with 1842 additions and 1820 deletions

View File

@ -1,9 +0,0 @@
build
translations/*
node_modules/*
hass_frontend/*
pip-selfcheck.json
# vscode
.vscode/*
!.vscode/extensions.json

View File

@ -85,8 +85,7 @@ class DemoHaAutomationEditorAction extends LitElement {
.value=${this.data[sampleIdx]} .value=${this.data[sampleIdx]}
> >
${["light", "dark"].map( ${["light", "dark"].map(
(slot) => (slot) => html`
html`
<ha-automation-action <ha-automation-action
slot=${slot} slot=${slot}
.hass=${this.hass} .hass=${this.hass}

View File

@ -121,8 +121,7 @@ class DemoHaAutomationEditorCondition extends LitElement {
.value=${this.data[sampleIdx]} .value=${this.data[sampleIdx]}
> >
${["light", "dark"].map( ${["light", "dark"].map(
(slot) => (slot) => html`
html`
<ha-automation-condition <ha-automation-condition
slot=${slot} slot=${slot}
.hass=${this.hass} .hass=${this.hass}

View File

@ -167,8 +167,7 @@ class DemoHaAutomationEditorTrigger extends LitElement {
.value=${this.data[sampleIdx]} .value=${this.data[sampleIdx]}
> >
${["light", "dark"].map( ${["light", "dark"].map(
(slot) => (slot) => html`
html`
<ha-automation-trigger <ha-automation-trigger
slot=${slot} slot=${slot}
.hass=${this.hass} .hass=${this.hass}

View File

@ -497,8 +497,7 @@ class DemoHaSelector extends LitElement implements ProvideHassElement {
<demo-black-white-row .title=${info.name} .value=${this.data[idx]}> <demo-black-white-row .title=${info.name} .value=${this.data[idx]}>
${["light", "dark"].map((slot) => ${["light", "dark"].map((slot) =>
Object.entries(info.input).map( Object.entries(info.input).map(
([key, value]) => ([key, value]) => html`
html`
<ha-settings-row narrow slot=${slot}> <ha-settings-row narrow slot=${slot}>
<span slot="heading">${value?.name || key}</span> <span slot="heading">${value?.name || key}</span>
<span slot="description">${value?.description}</span> <span slot="description">${value?.description}</span>

View File

@ -20,9 +20,8 @@ export class DemoHaTip extends LitElement {
<ha-card header="ha-tip ${mode} demo"> <ha-card header="ha-tip ${mode} demo">
<div class="card-content"> <div class="card-content">
${tips.map( ${tips.map(
(tip) => html`<ha-tip .hass=${provideHass(this)} (tip) =>
>${tip}</ha-tip html`<ha-tip .hass=${provideHass(this)}>${tip}</ha-tip>`
>`
)} )}
</div> </div>
</ha-card> </ha-card>

View File

@ -544,8 +544,7 @@ class HassioAddonInfo extends LitElement {
<code slot="description"> ${this.addon.hostname} </code> <code slot="description"> ${this.addon.hostname} </code>
</ha-settings-row> </ha-settings-row>
${metrics.map( ${metrics.map(
(metric) => (metric) => html`
html`
<supervisor-metric <supervisor-metric
.description=${metric.description} .description=${metric.description}
.value=${metric.value ?? 0} .value=${metric.value ?? 0}

View File

@ -384,7 +384,8 @@ export class SupervisorBackupContent extends LitElement {
: undefined; : undefined;
let checkedItems = 0; let checkedItems = 0;
this[section].forEach((item) => { this[section].forEach((item) => {
templates.push(html`<ha-formfield templates.push(
html`<ha-formfield
.label=${html`<supervisor-formfield-label .label=${html`<supervisor-formfield-label
.label=${item.name} .label=${item.name}
.iconPath=${section === "addons" ? mdiPuzzle : mdiFolder} .iconPath=${section === "addons" ? mdiPuzzle : mdiFolder}
@ -405,7 +406,8 @@ export class SupervisorBackupContent extends LitElement {
@change=${this._updateSectionEntry} @change=${this._updateSectionEntry}
> >
</ha-checkbox> </ha-checkbox>
</ha-formfield>`); </ha-formfield>`
);
if (item.checked) { if (item.checked) {
checkedItems++; checkedItems++;

View File

@ -168,8 +168,7 @@ export class DialogHassioNetwork
${this._accessPoints.accesspoints ${this._accessPoints.accesspoints
.filter((ap) => ap.ssid) .filter((ap) => ap.ssid)
.map( .map(
(ap) => (ap) => html`
html`
<mwc-list-item <mwc-list-item
twoline twoline
@click=${this._selectAP} @click=${this._selectAP}

View File

@ -157,7 +157,8 @@ class HassioRegistriesDialog extends LitElement {
} }
public focus(): void { public focus(): void {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -209,7 +209,8 @@ class HassioRepositoriesDialog extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -81,8 +81,7 @@ class HassioCoreInfo extends LitElement {
</div> </div>
<div> <div>
${metrics.map( ${metrics.map(
(metric) => (metric) => html`
html`
<supervisor-metric <supervisor-metric
.description=${metric.description} .description=${metric.description}
.value=${metric.value ?? 0} .value=${metric.value ?? 0}

View File

@ -154,8 +154,7 @@ class HassioHostInfo extends LitElement {
</ha-settings-row>` </ha-settings-row>`
: ""} : ""}
${metrics.map( ${metrics.map(
(metric) => (metric) => html`
html`
<supervisor-metric <supervisor-metric
.description=${metric.description} .description=${metric.description}
.value=${metric.value ?? 0} .value=${metric.value ?? 0}

View File

@ -178,8 +178,7 @@ class HassioSupervisorInfo extends LitElement {
</div> </div>
<div class="metrics-block"> <div class="metrics-block">
${metrics.map( ${metrics.map(
(metric) => (metric) => html`
html`
<supervisor-metric <supervisor-metric
.description=${metric.description} .description=${metric.description}
.value=${metric.value ?? 0} .value=${metric.value ?? 0}

View File

@ -227,7 +227,7 @@
"object-hash": "3.0.0", "object-hash": "3.0.0",
"open": "9.1.0", "open": "9.1.0",
"pinst": "3.0.0", "pinst": "3.0.0",
"prettier": "2.8.8", "prettier": "3.0.0",
"rollup": "2.79.1", "rollup": "2.79.1",
"rollup-plugin-string": "3.0.0", "rollup-plugin-string": "3.0.0",
"rollup-plugin-terser": "7.0.2", "rollup-plugin-terser": "7.0.2",
@ -256,9 +256,5 @@
"sortablejs@1.15.0": "patch:sortablejs@npm%3A1.15.0#./.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch", "sortablejs@1.15.0": "patch:sortablejs@npm%3A1.15.0#./.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch",
"leaflet-draw@1.0.4": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch" "leaflet-draw@1.0.4": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch"
}, },
"prettier": {
"trailingComma": "es5",
"arrowParens": "always"
},
"packageManager": "yarn@3.6.1" "packageManager": "yarn@3.6.1"
} }

3
prettier.config.js Normal file
View File

@ -0,0 +1,3 @@
export default {
trailingComma: "es5",
};

View File

@ -38,7 +38,7 @@ export type LocalizeKeys =
// Tweaked from https://www.raygesualdo.com/posts/flattening-object-keys-with-typescript-types // Tweaked from https://www.raygesualdo.com/posts/flattening-object-keys-with-typescript-types
export type FlattenObjectKeys< export type FlattenObjectKeys<
T extends Record<string, any>, T extends Record<string, any>,
Key extends keyof T = keyof T Key extends keyof T = keyof T,
> = Key extends string > = Key extends string
? T[Key] extends Record<string, unknown> ? T[Key] extends Record<string, unknown>
? `${Key}.${FlattenObjectKeys<T[Key]>}` ? `${Key}.${FlattenObjectKeys<T[Key]>}`

View File

@ -108,7 +108,8 @@ export default class HaChartBase extends LitElement {
? html`<div class="chartLegend"> ? html`<div class="chartLegend">
<ul> <ul>
${this.data.datasets.map( ${this.data.datasets.map(
(dataset, index) => html`<li (dataset, index) =>
html`<li
.datasetIndex=${index} .datasetIndex=${index}
@click=${this._legendClick} @click=${this._legendClick}
class=${classMap({ class=${classMap({
@ -156,7 +157,8 @@ export default class HaChartBase extends LitElement {
<div> <div>
<ul> <ul>
${this._tooltip.body.map( ${this._tooltip.body.map(
(item, i) => html`<li> (item, i) =>
html`<li>
<div <div
class="bullet" class="bullet"
style=${styleMap({ style=${styleMap({

View File

@ -36,9 +36,8 @@ interface AreaDevices {
devices: string[]; devices: string[];
} }
const rowRenderer: ComboBoxLitRenderer<AreaDevices> = ( const rowRenderer: ComboBoxLitRenderer<AreaDevices> = (item) =>
item html`<mwc-list-item twoline>
) => html`<mwc-list-item twoline>
<span>${item.name}</span> <span>${item.name}</span>
<span slot="secondary">${item.devices.length} devices</span> <span slot="secondary">${item.devices.length} devices</span>
</mwc-list-item>`; </mwc-list-item>`;

View File

@ -17,7 +17,7 @@ const NO_AUTOMATION_KEY = "NO_AUTOMATION";
const UNKNOWN_AUTOMATION_KEY = "UNKNOWN_AUTOMATION"; const UNKNOWN_AUTOMATION_KEY = "UNKNOWN_AUTOMATION";
export abstract class HaDeviceAutomationPicker< export abstract class HaDeviceAutomationPicker<
T extends DeviceAutomation T extends DeviceAutomation,
> extends LitElement { > extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;

View File

@ -45,9 +45,8 @@ export type HaDevicePickerDeviceFilterFunc = (
export type HaDevicePickerEntityFilterFunc = (entity: HassEntity) => boolean; export type HaDevicePickerEntityFilterFunc = (entity: HassEntity) => boolean;
const rowRenderer: ComboBoxLitRenderer<Device> = (item) => html`<mwc-list-item const rowRenderer: ComboBoxLitRenderer<Device> = (item) =>
.twoline=${!!item.area} html`<mwc-list-item .twoline=${!!item.area}>
>
<span>${item.name}</span> <span>${item.name}</span>
<span slot="secondary">${item.area}</span> <span slot="secondary">${item.area}</span>
</mwc-list-item>`; </mwc-list-item>`;

View File

@ -87,11 +87,13 @@ export class HaStatisticPicker extends LitElement {
private _statistics: StatisticItem[] = []; private _statistics: StatisticItem[] = [];
private _rowRenderer: ComboBoxLitRenderer<StatisticItem> = ( private _rowRenderer: ComboBoxLitRenderer<StatisticItem> = (item) =>
item html`<mwc-list-item graphic="avatar" twoline>
) => html`<mwc-list-item graphic="avatar" twoline>
${item.state ${item.state
? html`<state-badge slot="graphic" .stateObj=${item.state}></state-badge>` ? html`<state-badge
slot="graphic"
.stateObj=${item.state}
></state-badge>`
: ""} : ""}
<span>${item.name}</span> <span>${item.name}</span>
<span slot="secondary" <span slot="secondary"

View File

@ -211,7 +211,9 @@ export class StateBadge extends LitElement {
background: var(--divider-color); background: var(--divider-color);
} }
ha-state-icon { ha-state-icon {
transition: color 0.3s ease-in-out, filter 0.3s ease-in-out; transition:
color 0.3s ease-in-out,
filter 0.3s ease-in-out;
} }
.missing { .missing {
color: #fce588; color: #fce588;

View File

@ -11,9 +11,8 @@ import "./ha-combo-box";
import type { HaComboBox } from "./ha-combo-box"; import type { HaComboBox } from "./ha-combo-box";
import "./ha-list-item"; import "./ha-list-item";
const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = ( const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (item) =>
item html`<ha-list-item twoline graphic="icon">
) => html`<ha-list-item twoline graphic="icon">
<span>${item.name}</span> <span>${item.name}</span>
<span slot="secondary">${item.slug}</span> <span slot="secondary">${item.slug}</span>
${item.icon ${item.icon

View File

@ -53,8 +53,7 @@ export class HaAnalytics extends LitElement {
</ha-switch> </ha-switch>
</ha-settings-row> </ha-settings-row>
${ADDITIONAL_PREFERENCES.map( ${ADDITIONAL_PREFERENCES.map(
(preference) => (preference) => html`
html`
<ha-settings-row> <ha-settings-row>
<span slot="heading" data-for=${preference}> <span slot="heading" data-for=${preference}>
${this.localize( ${this.localize(

View File

@ -34,9 +34,8 @@ import "./ha-svg-icon";
type ScorableAreaRegistryEntry = ScorableTextItem & AreaRegistryEntry; type ScorableAreaRegistryEntry = ScorableTextItem & AreaRegistryEntry;
const rowRenderer: ComboBoxLitRenderer<AreaRegistryEntry> = ( const rowRenderer: ComboBoxLitRenderer<AreaRegistryEntry> = (item) =>
item html`<mwc-list-item
) => html`<mwc-list-item
class=${classMap({ "add-new": item.area_id === "add_new" })} class=${classMap({ "add-new": item.area_id === "add_new" })}
> >
${item.name} ${item.name}

View File

@ -94,7 +94,9 @@ export class HaButtonToggleGroup extends LitElement {
opacity: 0; opacity: 0;
pointer-events: none; pointer-events: none;
content: ""; content: "";
transition: opacity 15ms linear, background-color 15ms linear; transition:
opacity 15ms linear,
background-color 15ms linear;
} }
ha-icon-button[active]::before, ha-icon-button[active]::before,
mwc-button[active]::before { mwc-button[active]::before {

View File

@ -47,9 +47,8 @@ class HaConfigEntryPicker extends LitElement {
this._getConfigEntries(); this._getConfigEntries();
} }
private _rowRenderer: ComboBoxLitRenderer<ConfigEntryExtended> = ( private _rowRenderer: ComboBoxLitRenderer<ConfigEntryExtended> = (item) =>
item html`<mwc-list-item twoline graphic="icon">
) => html`<mwc-list-item twoline graphic="icon">
<span <span
>${item.title || >${item.title ||
this.hass.localize( this.hass.localize(

View File

@ -122,7 +122,8 @@ export class HaControlButton extends LitElement {
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: var(--control-button-background-color); background-color: var(--control-button-background-color);
transition: background-color 180ms ease-in-out, transition:
background-color 180ms ease-in-out,
opacity 180ms ease-in-out; opacity 180ms ease-in-out;
opacity: var(--control-button-background-opacity); opacity: var(--control-button-background-opacity);
} }

View File

@ -566,7 +566,9 @@ export class HaControlCircularSlider extends LitElement {
fill: none; fill: none;
stroke: var(--control-circular-slider-background); stroke: var(--control-circular-slider-background);
opacity: var(--control-circular-slider-background-opacity); opacity: var(--control-circular-slider-background-opacity);
transition: stroke 180ms ease-in-out, opacity 180ms ease-in-out; transition:
stroke 180ms ease-in-out,
opacity 180ms ease-in-out;
stroke-linecap: round; stroke-linecap: round;
stroke-width: 24px; stroke-width: 24px;
} }
@ -576,9 +578,11 @@ export class HaControlCircularSlider extends LitElement {
fill: none; fill: none;
stroke-linecap: round; stroke-linecap: round;
stroke-width: 24px; stroke-width: 24px;
transition: stroke-width 300ms ease-in-out, transition:
stroke-width 300ms ease-in-out,
stroke-dasharray 300ms ease-in-out, stroke-dasharray 300ms ease-in-out,
stroke-dashoffset 300ms ease-in-out, stroke 180ms ease-in-out, stroke-dashoffset 300ms ease-in-out,
stroke 180ms ease-in-out,
opacity 180ms ease-in-out; opacity 180ms ease-in-out;
} }

View File

@ -283,7 +283,9 @@ export class HaControlSelect extends LitElement {
width: 100%; width: 100%;
background-color: var(--control-select-color); background-color: var(--control-select-color);
opacity: 0; opacity: 0;
transition: background-color ease-in-out 180ms, opacity ease-in-out 80ms; transition:
background-color ease-in-out 180ms,
opacity ease-in-out 80ms;
} }
.option.focused::before, .option.focused::before,
.option:hover::before { .option:hover::before {

View File

@ -327,7 +327,8 @@ export class HaControlSlider extends LitElement {
height: 100%; height: 100%;
width: 100%; width: 100%;
background-color: var(--control-slider-color); background-color: var(--control-slider-color);
transition: transform 180ms ease-in-out, transition:
transform 180ms ease-in-out,
background-color 180ms ease-in-out; background-color 180ms ease-in-out;
} }
.slider .slider-track-bar.show-handle { .slider .slider-track-bar.show-handle {
@ -427,7 +428,9 @@ export class HaControlSlider extends LitElement {
position: absolute; position: absolute;
background-color: white; background-color: white;
border-radius: var(--handle-size); border-radius: var(--handle-size);
transition: left 180ms ease-in-out, bottom 180ms ease-in-out; transition:
left 180ms ease-in-out,
bottom 180ms ease-in-out;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: calc(var(--value, 0) * (100% - var(--cursor-size))); left: calc(var(--value, 0) * (100% - var(--cursor-size)));

View File

@ -208,7 +208,8 @@ export class HaControlSwitch extends LitElement {
border-radius: calc( border-radius: calc(
var(--control-switch-border-radius) - var(--control-switch-padding) var(--control-switch-border-radius) - var(--control-switch-padding)
); );
transition: transform 180ms ease-in-out, transition:
transform 180ms ease-in-out,
background-color 180ms ease-in-out; background-color 180ms ease-in-out;
background-color: var(--control-switch-off-color); background-color: var(--control-switch-off-color);
color: white; color: white;

View File

@ -55,8 +55,7 @@ export class HaFormGrid extends LitElement implements HaFormElement {
protected render(): TemplateResult { protected render(): TemplateResult {
return html` return html`
${this.schema.schema.map( ${this.schema.schema.map(
(item) => (item) => html`
html`
<ha-form <ha-form
.hass=${this.hass} .hass=${this.hass}
.data=${this.data} .data=${this.data}

View File

@ -98,7 +98,7 @@ export interface HaFormTimeSchema extends HaFormBaseSchema {
// Type utility to unionize a schema array by flattening any grid schemas // Type utility to unionize a schema array by flattening any grid schemas
export type SchemaUnion< export type SchemaUnion<
SchemaArray extends readonly HaFormSchema[], SchemaArray extends readonly HaFormSchema[],
Schema = SchemaArray[number] Schema = SchemaArray[number],
> = Schema extends HaFormGridSchema | HaFormExpandableSchema > = Schema extends HaFormGridSchema | HaFormExpandableSchema
? SchemaUnion<Schema["schema"]> ? SchemaUnion<Schema["schema"]>
: Schema; : Schema;

View File

@ -406,7 +406,9 @@ class HaHsColorPicker extends LitElement {
filter: url(#marker-shadow); filter: url(#marker-shadow);
} }
.container:not(.pressed) circle { .container:not(.pressed) circle {
transition: transform 100ms ease-in-out, fill 100ms ease-in-out; transition:
transform 100ms ease-in-out,
fill 100ms ease-in-out;
} }
.container:not(.pressed) .cursor { .container:not(.pressed) .cursor {
transition: transform 200ms ease-in-out; transition: transform 200ms ease-in-out;

View File

@ -81,11 +81,8 @@ class HaMountPicker extends LitElement {
? dataDiskOption ? dataDiskOption
: nothing} : nothing}
${this._filterMounts(this._mounts, this.usage).map( ${this._filterMounts(this._mounts, this.usage).map(
(mount) => html`<ha-list-item (mount) =>
twoline html`<ha-list-item twoline graphic="icon" .value=${mount.name}>
graphic="icon"
.value=${mount.name}
>
<span>${mount.name}</span> <span>${mount.name}</span>
<span slot="secondary" <span slot="secondary"
>${mount.server}${mount.port >${mount.server}${mount.port

View File

@ -112,11 +112,10 @@ export class HaSelectSelector extends LitElement {
${value?.length ${value?.length
? html`<ha-chip-set> ? html`<ha-chip-set>
${value.map( ${value.map(
(item, idx) => (item, idx) => html`
html`
<ha-chip hasTrailingIcon> <ha-chip hasTrailingIcon>
${options.find((option) => option.value === item) ${options.find((option) => option.value === item)?.label ||
?.label || item} item}
<ha-svg-icon <ha-svg-icon
slot="trailing-icon" slot="trailing-icon"
.path=${mdiClose} .path=${mdiClose}

View File

@ -10,7 +10,8 @@ import "./ha-combo-box";
const rowRenderer: ComboBoxLitRenderer<{ service: string; name: string }> = ( const rowRenderer: ComboBoxLitRenderer<{ service: string; name: string }> = (
item item
) => html`<mwc-list-item twoline> ) =>
html`<mwc-list-item twoline>
<span>${item.name}</span> <span>${item.name}</span>
<span slot="secondary" <span slot="secondary"
>${item.name === item.service ? "" : item.service}</span >${item.name === item.service ? "" : item.service}</span

View File

@ -418,7 +418,9 @@ class HaTempColorPicker extends LitElement {
filter: url(#marker-shadow); filter: url(#marker-shadow);
} }
.container:not(.pressed) circle { .container:not(.pressed) circle {
transition: transform 100ms ease-in-out, fill 100ms ease-in-out; transition:
transform 100ms ease-in-out,
fill 100ms ease-in-out;
} }
.container:not(.pressed) .cursor { .container:not(.pressed) .cursor {
transition: transform 200ms ease-in-out; transition: transform 200ms ease-in-out;

View File

@ -62,7 +62,8 @@ export class HaTTSVoicePicker extends LitElement {
</ha-list-item>` </ha-list-item>`
: nothing} : nothing}
${this._voices.map( ${this._voices.map(
(voice) => html`<ha-list-item .value=${voice.voice_id}> (voice) =>
html`<ha-list-item .value=${voice.voice_id}>
${voice.name} ${voice.name}
</ha-list-item>` </ha-list-item>`
)} )}

View File

@ -930,7 +930,9 @@ export class HaMediaPlayerBrowse extends LitElement {
margin-right: 16px; margin-right: 16px;
background-size: cover; background-size: cover;
border-radius: 2px; border-radius: 2px;
transition: width 0.4s, height 0.4s; transition:
width 0.4s,
height 0.4s;
} }
.header-info { .header-info {
display: flex; display: flex;
@ -977,7 +979,9 @@ export class HaMediaPlayerBrowse extends LitElement {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-bottom: 0; margin-bottom: 0;
transition: height 0.5s, margin 0.5s; transition:
height 0.5s,
margin 0.5s;
} }
.not-shown { .not-shown {
@ -1121,7 +1125,9 @@ export class HaMediaPlayerBrowse extends LitElement {
top: auto; top: auto;
bottom: 0px; bottom: 0px;
right: 8px; right: 8px;
transition: bottom 0.1s ease-out, opacity 0.1s ease-out; transition:
bottom 0.1s ease-out,
opacity 0.1s ease-out;
} }
.child .play:hover { .child .play:hover {
@ -1220,7 +1226,10 @@ export class HaMediaPlayerBrowse extends LitElement {
position: relative; position: relative;
background-position: center; background-position: center;
border-radius: 0; border-radius: 0;
transition: width 0.4s, height 0.4s, padding-bottom 0.4s; transition:
width 0.4s,
height 0.4s,
padding-bottom 0.4s;
} }
ha-fab { ha-fab {
position: absolute; position: absolute;

View File

@ -40,7 +40,9 @@ class HaUsersPickerLight extends LitElement {
const notSelectedUsers = this._notSelectedUsers(this.users, this.value); const notSelectedUsers = this._notSelectedUsers(this.users, this.value);
return html` return html`
${guard([notSelectedUsers], () => ${guard(
[notSelectedUsers],
() =>
this.value?.map( this.value?.map(
(user_id, idx) => html` (user_id, idx) => html`
<div> <div>

View File

@ -13,7 +13,7 @@ interface InvalidConfig {
type ValidKeys = "trigger" | "action" | "condition"; type ValidKeys = "trigger" | "action" | "condition";
export const validateConfig = < export const validateConfig = <
T extends Partial<{ [key in ValidKeys]: unknown }> T extends Partial<{ [key in ValidKeys]: unknown }>,
>( >(
hass: HomeAssistant, hass: HomeAssistant,
config: T config: T

View File

@ -14,7 +14,7 @@ declare global {
export type ValidUserDataKey = keyof FrontendUserData; export type ValidUserDataKey = keyof FrontendUserData;
export const fetchFrontendUserData = async < export const fetchFrontendUserData = async <
UserDataKey extends ValidUserDataKey UserDataKey extends ValidUserDataKey,
>( >(
conn: Connection, conn: Connection,
key: UserDataKey key: UserDataKey
@ -29,7 +29,7 @@ export const fetchFrontendUserData = async <
}; };
export const saveFrontendUserData = async < export const saveFrontendUserData = async <
UserDataKey extends ValidUserDataKey UserDataKey extends ValidUserDataKey,
>( >(
conn: Connection, conn: Connection,
key: UserDataKey, key: UserDataKey,
@ -42,7 +42,7 @@ export const saveFrontendUserData = async <
}); });
export const getOptimisticFrontendUserDataCollection = < export const getOptimisticFrontendUserDataCollection = <
UserDataKey extends ValidUserDataKey UserDataKey extends ValidUserDataKey,
>( >(
conn: Connection, conn: Connection,
userDataKey: UserDataKey userDataKey: UserDataKey

View File

@ -145,8 +145,7 @@ export interface DeviceSelector {
} }
export interface LegacyDeviceSelector { export interface LegacyDeviceSelector {
device: device: DeviceSelector["device"] & {
| DeviceSelector["device"] & {
/** /**
* @deprecated Use filter instead * @deprecated Use filter instead
*/ */
@ -185,8 +184,7 @@ export interface EntitySelector {
} }
export interface LegacyEntitySelector { export interface LegacyEntitySelector {
entity: entity: EntitySelector["entity"] & {
| EntitySelector["entity"] & {
/** /**
* @deprecated Use filter instead * @deprecated Use filter instead
*/ */

View File

@ -48,8 +48,7 @@ class StepFlowCreateEntry extends LitElement {
</p> </p>
<div class="devices"> <div class="devices">
${this.devices.map( ${this.devices.map(
(device) => (device) => html`
html`
<div class="device"> <div class="device">
<div> <div>
<b>${computeDeviceName(device, this.hass)}</b><br /> <b>${computeDeviceName(device, this.hass)}</b><br />

View File

@ -150,8 +150,7 @@ class DialogLightColorFavorite extends LitElement {
? html` ? html`
<div class="modes"> <div class="modes">
${this._modes.map( ${this._modes.map(
(value) => (value) => html`
html`
<ha-icon-button-toggle <ha-icon-button-toggle
border-only border-only
.selected=${value === this._mode} .selected=${value === this._mode}

View File

@ -415,7 +415,7 @@ class LightRgbColorPicker extends LitElement {
number, number,
number, number,
number, number,
number number,
]; ];
this._applyColor({ rgbww_color }); this._applyColor({ rgbww_color });
} else if (lightSupportsColorMode(this.stateObj!, LightColorMode.RGBW)) { } else if (lightSupportsColorMode(this.stateObj!, LightColorMode.RGBW)) {
@ -427,7 +427,7 @@ class LightRgbColorPicker extends LitElement {
number, number,
number, number,
number, number,
number number,
]; ];
this._applyColor({ rgbw_color }); this._applyColor({ rgbw_color });
} }

View File

@ -36,7 +36,8 @@ export class MoreInfoConfigurator extends LitElement {
</ha-alert>` </ha-alert>`
: ""} : ""}
${this.stateObj.attributes.fields.map( ${this.stateObj.attributes.fields.map(
(field) => html`<ha-textfield (field) =>
html`<ha-textfield
.label=${field.name} .label=${field.name}
.name=${field.id} .name=${field.id}
.type=${field.type} .type=${field.type}

View File

@ -299,8 +299,7 @@ class MoreInfoFan extends LitElement {
></ha-svg-icon> ></ha-svg-icon>
</ha-outlined-button> </ha-outlined-button>
${this.stateObj.attributes.preset_modes?.map( ${this.stateObj.attributes.preset_modes?.map(
(mode) => (mode) => html`
html`
<ha-list-item <ha-list-item
.value=${mode} .value=${mode}
.activated=${this._presetMode === mode} .activated=${this._presetMode === mode}

View File

@ -156,8 +156,7 @@ class MoreInfoMediaPlayer extends LitElement {
@closed=${stopPropagation} @closed=${stopPropagation}
> >
${stateObj.attributes.source_list!.map( ${stateObj.attributes.source_list!.map(
(source) => (source) => html`
html`
<mwc-list-item .value=${source} <mwc-list-item .value=${source}
>${computeAttributeValueDisplay( >${computeAttributeValueDisplay(
this.hass.localize, this.hass.localize,

View File

@ -108,7 +108,8 @@ export class HuiNotificationDrawer extends LitElement {
<div class="notifications"> <div class="notifications">
${notifications.length ${notifications.length
? html`${notifications.map( ? html`${notifications.map(
(notification) => html`<div class="notification"> (notification) =>
html`<div class="notification">
<notification-item <notification-item
.hass=${this.hass} .hass=${this.hass}
.notification=${notification} .notification=${notification}

View File

@ -158,7 +158,8 @@ export class HaVoiceCommandDialog extends LitElement {
></ha-svg-icon> ></ha-svg-icon>
</ha-button> </ha-button>
${this._pipelines?.map( ${this._pipelines?.map(
(pipeline) => html`<ha-list-item (pipeline) =>
html`<ha-list-item
?selected=${pipeline.id === this._pipelineId || ?selected=${pipeline.id === this._pipelineId ||
(!this._pipelineId && (!this._pipelineId &&
pipeline.id === this._preferredPipeline)} pipeline.id === this._preferredPipeline)}
@ -168,7 +169,10 @@ export class HaVoiceCommandDialog extends LitElement {
> >
${pipeline.name}${pipeline.id === this._preferredPipeline ${pipeline.name}${pipeline.id === this._preferredPipeline
? html` ? html`
<ha-svg-icon slot="meta" .path=${mdiStar}></ha-svg-icon> <ha-svg-icon
slot="meta"
.path=${mdiStar}
></ha-svg-icon>
` `
: nothing} : nothing}
</ha-list-item>` </ha-list-item>`

View File

@ -94,8 +94,7 @@ class HassTabsSubpage extends LitElement {
} }
return shownTabs.map( return shownTabs.map(
(page) => (page) => html`
html`
<a href=${page.path}> <a href=${page.path}>
<ha-tab <ha-tab
.hass=${this.hass} .hass=${this.hass}

View File

@ -79,8 +79,7 @@ class PanelCalendar extends LitElement {
${this.hass.localize("ui.components.calendar.my_calendars")} ${this.hass.localize("ui.components.calendar.my_calendars")}
</div> </div>
${this._calendars.map( ${this._calendars.map(
(selCal) => (selCal) => html`
html`
<div> <div>
<mwc-formfield .label=${selCal.name}> <mwc-formfield .label=${selCal.name}>
<mwc-checkbox <mwc-checkbox

View File

@ -28,7 +28,8 @@ interface Domain {
name: string; name: string;
} }
const rowRenderer: ComboBoxLitRenderer<Domain> = (item) => html`<mwc-list-item> const rowRenderer: ComboBoxLitRenderer<Domain> = (item) =>
html`<mwc-list-item>
<span>${item.name}</span> <span>${item.name}</span>
</mwc-list-item>`; </mwc-list-item>`;

View File

@ -283,8 +283,7 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) {
.header=${this.hass.localize("ui.panel.config.devices.caption")} .header=${this.hass.localize("ui.panel.config.devices.caption")}
>${devices.length >${devices.length
? devices.map( ? devices.map(
(device) => (device) => html`
html`
<a href="/config/devices/device/${device.id}"> <a href="/config/devices/device/${device.id}">
<paper-item> <paper-item>
<paper-item-body> ${device.name} </paper-item-body> <paper-item-body> ${device.name} </paper-item-body>

View File

@ -109,7 +109,8 @@ export class HaChooseAction extends LitElement implements ActionElement {
return html` return html`
${(action.choose ? ensureArray(action.choose) : []).map( ${(action.choose ? ensureArray(action.choose) : []).map(
(option, idx) => html`<ha-card> (option, idx) =>
html`<ha-card>
<ha-expansion-panel <ha-expansion-panel
leftChevron leftChevron
@expanded-changed=${this._expandedChanged} @expanded-changed=${this._expandedChanged}

View File

@ -212,8 +212,7 @@ class HaAutomationPicker extends LitElement {
title: "", title: "",
width: this.narrow ? undefined : "10%", width: this.narrow ? undefined : "10%",
type: "overflow-menu", type: "overflow-menu",
template: (_: string, automation: any) => template: (_: string, automation: any) => html`
html`
<ha-icon-overflow-menu <ha-icon-overflow-menu
.hass=${this.hass} .hass=${this.hass}
narrow narrow

View File

@ -133,8 +133,7 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
<div> <div>
${this._error ? html` <div class="error">${this._error}</div> ` : ""} ${this._error ? html` <div class="error">${this._error}</div> ` : ""}
${Object.entries(this.placeholders).map( ${Object.entries(this.placeholders).map(
([type, placeholders]) => ([type, placeholders]) => html`
html`
<h3> <h3>
${this.hass.localize( ${this.hass.localize(
`ui.panel.config.automation.editor.${type}s.name` `ui.panel.config.automation.editor.${type}s.name`
@ -230,9 +229,7 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
`ui.panel.config.automation.thingtalk.link_devices.unknown_placeholder` `ui.panel.config.automation.thingtalk.link_devices.unknown_placeholder`
)}<br /> )}<br />
${placeholder.domains}<br /> ${placeholder.domains}<br />
${placeholder.fields.map( ${placeholder.fields.map((field) => html` ${field}<br /> `)}
(field) => html` ${field}<br /> `
)}
</div> </div>
`; `;
})} })}

View File

@ -125,8 +125,7 @@ class HaBlueprintOverview extends LitElement {
direction: "asc", direction: "asc",
grows: true, grows: true,
template: narrow template: narrow
? (name, entity: any) => ? (name, entity: any) => html`
html`
${name}<br /> ${name}<br />
<div class="secondary">${entity.path}</div> <div class="secondary">${entity.path}</div>
` `

View File

@ -181,9 +181,8 @@ class HaConfigSystemNavigation extends LitElement {
const hardwareInfo: HardwareInfo = await this.hass.callWS({ const hardwareInfo: HardwareInfo = await this.hass.callWS({
type: "hardware/info", type: "hardware/info",
}); });
this._boardName = hardwareInfo?.hardware.find( this._boardName = hardwareInfo?.hardware.find((hw) => hw.board !== null)
(hw) => hw.board !== null ?.name;
)?.name;
} else if (isHassioLoaded) { } else if (isHassioLoaded) {
const osData: HassioHassOSInfo = await fetchHassioHassOsInfo(this.hass); const osData: HassioHassOSInfo = await fetchHassioHassOsInfo(this.hass);
if (osData.board) { if (osData.board) {

View File

@ -20,7 +20,7 @@ declare global {
} }
export abstract class HaDeviceAutomationCard< export abstract class HaDeviceAutomationCard<
T extends DeviceAutomation T extends DeviceAutomation,
> extends LitElement { > extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant; @property({ attribute: false }) public hass!: HomeAssistant;
@ -76,8 +76,7 @@ export abstract class HaDeviceAutomationCard<
<div class="content"> <div class="content">
<ha-chip-set> <ha-chip-set>
${automations.map( ${automations.map(
(automation, idx) => (automation, idx) => html`
html`
<ha-chip <ha-chip
.index=${idx} .index=${idx}
@click=${this._handleAutomationClicked} @click=${this._handleAutomationClicked}

View File

@ -376,8 +376,7 @@ export class HaConfigDevicePage extends LitElement {
const firstDeviceAction = actions.shift(); const firstDeviceAction = actions.shift();
if (device.disabled_by) { if (device.disabled_by) {
deviceInfo.push( deviceInfo.push(html`
html`
<ha-alert alert-type="warning"> <ha-alert alert-type="warning">
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.devices.enabled_cause", "ui.panel.config.devices.enabled_cause",
@ -400,8 +399,7 @@ export class HaConfigDevicePage extends LitElement {
</div> </div>
` `
: ""} : ""}
` `);
);
} }
this._renderIntegrationInfo(device, integrations, deviceInfo); this._renderIntegrationInfo(device, integrations, deviceInfo);
@ -751,8 +749,7 @@ export class HaConfigDevicePage extends LitElement {
? html` ? html`
<div> <div>
${this._deviceAlerts.map( ${this._deviceAlerts.map(
(alert) => (alert) => html`
html`
<ha-alert .alertType=${alert.level}> <ha-alert .alertType=${alert.level}>
${alert.text} ${alert.text}
</ha-alert> </ha-alert>

View File

@ -76,8 +76,7 @@ export class EnergyBatterySettings extends LitElement {
> >
</p> </p>
${batteryValidation.map( ${batteryValidation.map(
(result) => (result) => html`
html`
<ha-energy-validation-result <ha-energy-validation-result
.hass=${this.hass} .hass=${this.hass}
.issues=${result} .issues=${result}

View File

@ -68,8 +68,7 @@ export class EnergyDeviceSettings extends LitElement {
> >
</p> </p>
${this.validationResult?.device_consumption.map( ${this.validationResult?.device_consumption.map(
(result) => (result) => html`
html`
<ha-energy-validation-result <ha-energy-validation-result
.hass=${this.hass} .hass=${this.hass}
.issues=${result} .issues=${result}

View File

@ -74,8 +74,7 @@ export class EnergyGasSettings extends LitElement {
> >
</p> </p>
${gasValidation.map( ${gasValidation.map(
(result) => (result) => html`
html`
<ha-energy-validation-result <ha-energy-validation-result
.hass=${this.hass} .hass=${this.hass}
.issues=${result} .issues=${result}

View File

@ -79,8 +79,7 @@ export class EnergySolarSettings extends LitElement {
> >
</p> </p>
${solarValidation.map( ${solarValidation.map(
(result) => (result) => html`
html`
<ha-energy-validation-result <ha-energy-validation-result
.hass=${this.hass} .hass=${this.hass}
.issues=${result} .issues=${result}

View File

@ -75,8 +75,7 @@ export class EnergyWaterSettings extends LitElement {
> >
</p> </p>
${waterValidation.map( ${waterValidation.map(
(result) => (result) => html`
html`
<ha-energy-validation-result <ha-energy-validation-result
.hass=${this.hass} .hass=${this.hass}
.issues=${result} .issues=${result}

View File

@ -139,7 +139,8 @@ export class DialogEnergySolarSettings
${this._forecast ${this._forecast
? html`<div class="forecast-options"> ? html`<div class="forecast-options">
${this._configEntries?.map( ${this._configEntries?.map(
(entry) => html`<ha-formfield (entry) =>
html`<ha-formfield
.label=${html`<div .label=${html`<div
style="display: flex; align-items: center;" style="display: flex; align-items: center;"
> >

View File

@ -892,11 +892,9 @@ export class EntityRegistrySettingsEditor extends LitElement {
"ui.dialogs.entity_registry.editor.use_device_area" "ui.dialogs.entity_registry.editor.use_device_area"
)} )}
${this.hass.devices[this.entry.device_id].area_id ${this.hass.devices[this.entry.device_id].area_id
? `(${ ? `(${this.hass.areas[
this.hass.areas[
this.hass.devices[this.entry.device_id].area_id! this.hass.devices[this.entry.device_id].area_id!
]?.name ]?.name})`
})`
: ""}</span : ""}</span
> >
<span slot="description" <span slot="description"

View File

@ -201,8 +201,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
direction: "asc", direction: "asc",
grows: true, grows: true,
template: narrow template: narrow
? (name, entity: EntityRow) => ? (name, entity: EntityRow) => html`
html`
${name}<br /> ${name}<br />
<div class="secondary"> <div class="secondary">
${entity.entity_id} | ${entity.entity_id} |

View File

@ -110,8 +110,7 @@ class DialogHardwareAvailable extends LitElement implements HassDialog {
</search-input> </search-input>
</div> </div>
${devices.map( ${devices.map(
(device) => (device) => html`
html`
<ha-expansion-panel <ha-expansion-panel
.header=${device.name} .header=${device.name}
.secondary=${device.by_id || undefined} .secondary=${device.by_id || undefined}

View File

@ -53,7 +53,8 @@ class HaCounterForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -31,7 +31,8 @@ class HaInputBooleanForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -31,7 +31,8 @@ class HaInputButtonForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -45,7 +45,8 @@ class HaInputDateTimeForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -60,7 +60,8 @@ class HaInputNumberForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -43,7 +43,8 @@ class HaInputSelectForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -50,7 +50,8 @@ class HaInputTextForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -98,7 +98,8 @@ class HaScheduleForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -39,7 +39,8 @@ class HaTimerForm extends LitElement {
} }
public focus() { public focus() {
this.updateComplete.then(() => this.updateComplete.then(
() =>
( (
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
)?.focus() )?.focus()

View File

@ -96,8 +96,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
filterable: true, filterable: true,
grows: true, grows: true,
direction: "asc", direction: "asc",
template: (name, item: any) => template: (name, item: any) => html`
html`
${name} ${name}
${narrow ${narrow
? html` <div class="secondary">${item.entity_id}</div> ` ? html` <div class="secondary">${item.entity_id}</div> `

View File

@ -410,7 +410,8 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
</h1> </h1>
<mwc-list> <mwc-list>
${discoveryFlows.map( ${discoveryFlows.map(
(flow) => html`<ha-list-item (flow) =>
html`<ha-list-item
hasMeta hasMeta
class="discovered" class="discovered"
noninteractive noninteractive

View File

@ -150,7 +150,7 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
): [ ): [
[string, ConfigEntryExtended[]][], [string, ConfigEntryExtended[]][],
ConfigEntryExtended[], ConfigEntryExtended[],
ConfigEntryExtended[] ConfigEntryExtended[],
] => { ] => {
let filteredConfigEntries: ConfigEntryExtended[]; let filteredConfigEntries: ConfigEntryExtended[];
const ignored: ConfigEntryExtended[] = []; const ignored: ConfigEntryExtended[] = [];

View File

@ -44,7 +44,8 @@ class HaDomainIntegrations extends LitElement {
${this.hass.localize("ui.panel.config.integrations.discovered")} ${this.hass.localize("ui.panel.config.integrations.discovered")}
</h3> </h3>
${this.flowsInProgress.map( ${this.flowsInProgress.map(
(flow) => html`<mwc-list-item (flow) =>
html`<mwc-list-item
graphic="medium" graphic="medium"
.flow=${flow} .flow=${flow}
@request-selected=${this._flowInProgressPicked} @request-selected=${this._flowInProgressPicked}

View File

@ -223,7 +223,8 @@ class ZHAConfigDashboard extends LitElement {
</ha-card> </ha-card>
${this._configuration ${this._configuration
? Object.entries(this._configuration.schemas).map( ? Object.entries(this._configuration.schemas).map(
([section, schema]) => html`<ha-card ([section, schema]) =>
html`<ha-card
header=${this.hass.localize( header=${this.hass.localize(
`component.zha.config_panel.${section}.title` `component.zha.config_panel.${section}.title`
)} )}

View File

@ -94,8 +94,9 @@ export class ZHAGroupsDashboard extends LitElement {
title: this.hass.localize("ui.panel.config.zha.groups.group_id"), title: this.hass.localize("ui.panel.config.zha.groups.group_id"),
type: "numeric", type: "numeric",
width: "15%", width: "15%",
template: (groupId: number) => template: (groupId: number) => html`
html` ${formatAsPaddedHex(groupId)} `, ${formatAsPaddedHex(groupId)}
`,
sortable: true, sortable: true,
}, },
members: { members: {

View File

@ -228,7 +228,8 @@ class DialogZWaveJSAddNode extends LitElement {
.sort() .sort()
.reverse() .reverse()
.map( .map(
(securityClass) => html`<ha-formfield (securityClass) =>
html`<ha-formfield
.label=${html`<b .label=${html`<b
>${this.hass.localize( >${this.hass.localize(
`ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.title` `ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.title`

View File

@ -364,7 +364,7 @@ class DialogZWaveJSNodeStatistics extends LitElement {
const workingRoutesValueMap: [ const workingRoutesValueMap: [
string, string,
WorkingRouteStatistics | null | undefined WorkingRouteStatistics | null | undefined,
][] = [ ][] = [
["lwr", this._nodeStatistics?.lwr], ["lwr", this._nodeStatistics?.lwr],
["nlwr", this._nodeStatistics?.nlwr], ["nlwr", this._nodeStatistics?.nlwr],

View File

@ -179,7 +179,8 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
item.endpoint.toString() item.endpoint.toString()
) )
).map( ).map(
([endpoint, configParamEntries]) => html`<div class="content"> ([endpoint, configParamEntries]) =>
html`<div class="content">
<h3> <h3>
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.zwave_js.node_config.endpoint", "ui.panel.config.zwave_js.node_config.endpoint",
@ -195,7 +196,8 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
: paramA.property_key! - paramB.property_key! : paramA.property_key! - paramB.property_key!
) )
.map( .map(
([id, item]) => html` <ha-settings-row ([id, item]) =>
html` <ha-settings-row
class="config-item" class="config-item"
.configId=${id} .configId=${id}
.narrow=${this.narrow} .narrow=${this.narrow}

View File

@ -123,8 +123,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
sortable: true, sortable: true,
filterable: true, filterable: true,
width: "20%", width: "20%",
template: (mode) => template: (mode) => html`
html`
${this.hass.localize( ${this.hass.localize(
`ui.panel.config.lovelace.dashboards.conf_mode.${mode}` `ui.panel.config.lovelace.dashboards.conf_mode.${mode}`
) || mode} ) || mode}

View File

@ -58,8 +58,7 @@ export class HaConfigLovelaceRescources extends LitElement {
sortable: true, sortable: true,
filterable: true, filterable: true,
width: "30%", width: "30%",
template: (type) => template: (type) => html`
html`
${this.hass.localize( ${this.hass.localize(
`ui.panel.config.lovelace.resources.types.${type}` `ui.panel.config.lovelace.resources.types.${type}`
) || type} ) || type}

View File

@ -139,8 +139,7 @@ export class HassioNetwork extends LitElement {
${this._accessPoints.accesspoints ${this._accessPoints.accesspoints
.filter((ap) => ap.ssid) .filter((ap) => ap.ssid)
.map( .map(
(ap) => (ap) => html`
html`
<mwc-list-item <mwc-list-item
twoline twoline
@click=${this._selectAP} @click=${this._selectAP}

View File

@ -305,13 +305,11 @@ class DialogSystemInformation extends LitElement {
const sections: TemplateResult[] = []; const sections: TemplateResult[] = [];
if (!this._systemInfo) { if (!this._systemInfo) {
sections.push( sections.push(html`
html`
<div class="loading-container"> <div class="loading-container">
<ha-circular-progress active></ha-circular-progress> <ha-circular-progress active></ha-circular-progress>
</div> </div>
` `);
);
} else { } else {
const domains = Object.keys(this._systemInfo).sort(sortKeys); const domains = Object.keys(this._systemInfo).sort(sortKeys);
for (const domain of domains) { for (const domain of domains) {
@ -371,8 +369,7 @@ class DialogSystemInformation extends LitElement {
`); `);
} }
if (domain !== "homeassistant") { if (domain !== "homeassistant") {
sections.push( sections.push(html`
html`
<div class="card-header"> <div class="card-header">
<h3>${domainToName(this.hass.localize, domain)}</h3> <h3>${domainToName(this.hass.localize, domain)}</h3>
${!domainInfo.manage_url ${!domainInfo.manage_url
@ -387,8 +384,7 @@ class DialogSystemInformation extends LitElement {
</a> </a>
`} `}
</div> </div>
` `);
);
} }
sections.push(html` sections.push(html`
<table> <table>

View File

@ -90,8 +90,9 @@ class HaSceneDashboard extends LitElement {
"ui.panel.config.scene.picker.headers.state" "ui.panel.config.scene.picker.headers.state"
), ),
type: "icon", type: "icon",
template: (_, scene) => template: (_, scene) => html`
html` <ha-state-icon .state=${scene}></ha-state-icon> `, <ha-state-icon .state=${scene}></ha-state-icon>
`,
}, },
name: { name: {
title: this.hass.localize( title: this.hass.localize(
@ -151,8 +152,7 @@ class HaSceneDashboard extends LitElement {
title: "", title: "",
width: "72px", width: "72px",
type: "overflow-menu", type: "overflow-menu",
template: (_: string, scene: any) => template: (_: string, scene: any) => html`
html`
<ha-icon-overflow-menu <ha-icon-overflow-menu
.hass=${this.hass} .hass=${this.hass}
narrow narrow

View File

@ -324,8 +324,7 @@ export class HaSceneEditor extends SubscribeMixin(
</div> </div>
${devices.map( ${devices.map(
(device) => (device) => html`
html`
<ha-card outlined> <ha-card outlined>
<h1 class="card-header"> <h1 class="card-header">
${device.name} ${device.name}

View File

@ -165,8 +165,7 @@ class HaScriptPicker extends LitElement {
title: "", title: "",
width: this.narrow ? undefined : "10%", width: this.narrow ? undefined : "10%",
type: "overflow-menu", type: "overflow-menu",
template: (_: string, script: any) => template: (_: string, script: any) => html`
html`
<ha-icon-overflow-menu <ha-icon-overflow-menu
.hass=${this.hass} .hass=${this.hass}
narrow narrow
@ -201,9 +200,7 @@ class HaScriptPicker extends LitElement {
action: () => this._duplicate(script), action: () => this._duplicate(script),
}, },
{ {
label: this.hass.localize( label: this.hass.localize("ui.panel.config.script.picker.delete"),
"ui.panel.config.script.picker.delete"
),
path: mdiDelete, path: mdiDelete,
action: () => this._deleteConfirm(script), action: () => this._deleteConfirm(script),
warning: true, warning: true,

View File

@ -70,7 +70,8 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
sortable: true, sortable: true,
filterable: true, filterable: true,
grows: true, grows: true,
template: (name, tag: any) => html`${name} template: (name, tag: any) =>
html`${name}
${narrow ${narrow
? html`<div class="secondary"> ? html`<div class="secondary">
${tag.last_scanned_datetime ${tag.last_scanned_datetime
@ -106,7 +107,8 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
title: "", title: "",
label: this.hass.localize("ui.panel.config.tag.headers.write"), label: this.hass.localize("ui.panel.config.tag.headers.write"),
type: "icon-button", type: "icon-button",
template: (_write, tag: any) => html` <ha-icon-button template: (_write, tag: any) =>
html` <ha-icon-button
.tag=${tag} .tag=${tag}
@click=${this._handleWriteClick} @click=${this._handleWriteClick}
.label=${this.hass.localize("ui.panel.config.tag.write")} .label=${this.hass.localize("ui.panel.config.tag.write")}
@ -117,17 +119,21 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
columns.automation = { columns.automation = {
title: "", title: "",
type: "icon-button", type: "icon-button",
template: (_automation, tag: any) => html` <ha-icon-button template: (_automation, tag: any) =>
html` <ha-icon-button
.tag=${tag} .tag=${tag}
@click=${this._handleAutomationClick} @click=${this._handleAutomationClick}
.label=${this.hass.localize("ui.panel.config.tag.create_automation")} .label=${this.hass.localize(
"ui.panel.config.tag.create_automation"
)}
.path=${mdiRobot} .path=${mdiRobot}
></ha-icon-button>`, ></ha-icon-button>`,
}; };
columns.edit = { columns.edit = {
title: "", title: "",
type: "icon-button", type: "icon-button",
template: (_settings, tag: any) => html` <ha-icon-button template: (_settings, tag: any) =>
html` <ha-icon-button
.tag=${tag} .tag=${tag}
@click=${this._handleEditClick} @click=${this._handleEditClick}
.label=${this.hass.localize("ui.panel.config.tag.edit")} .label=${this.hass.localize("ui.panel.config.tag.edit")}

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