mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-19 10:57:19 +00:00
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>
This commit is contained in:
parent
9bf76a07b8
commit
cb0bc762b1
@ -1,9 +0,0 @@
|
||||
build
|
||||
translations/*
|
||||
node_modules/*
|
||||
hass_frontend/*
|
||||
pip-selfcheck.json
|
||||
|
||||
# vscode
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
@ -85,8 +85,7 @@ class DemoHaAutomationEditorAction extends LitElement {
|
||||
.value=${this.data[sampleIdx]}
|
||||
>
|
||||
${["light", "dark"].map(
|
||||
(slot) =>
|
||||
html`
|
||||
(slot) => html`
|
||||
<ha-automation-action
|
||||
slot=${slot}
|
||||
.hass=${this.hass}
|
||||
|
@ -121,8 +121,7 @@ class DemoHaAutomationEditorCondition extends LitElement {
|
||||
.value=${this.data[sampleIdx]}
|
||||
>
|
||||
${["light", "dark"].map(
|
||||
(slot) =>
|
||||
html`
|
||||
(slot) => html`
|
||||
<ha-automation-condition
|
||||
slot=${slot}
|
||||
.hass=${this.hass}
|
||||
|
@ -167,8 +167,7 @@ class DemoHaAutomationEditorTrigger extends LitElement {
|
||||
.value=${this.data[sampleIdx]}
|
||||
>
|
||||
${["light", "dark"].map(
|
||||
(slot) =>
|
||||
html`
|
||||
(slot) => html`
|
||||
<ha-automation-trigger
|
||||
slot=${slot}
|
||||
.hass=${this.hass}
|
||||
|
@ -497,8 +497,7 @@ class DemoHaSelector extends LitElement implements ProvideHassElement {
|
||||
<demo-black-white-row .title=${info.name} .value=${this.data[idx]}>
|
||||
${["light", "dark"].map((slot) =>
|
||||
Object.entries(info.input).map(
|
||||
([key, value]) =>
|
||||
html`
|
||||
([key, value]) => html`
|
||||
<ha-settings-row narrow slot=${slot}>
|
||||
<span slot="heading">${value?.name || key}</span>
|
||||
<span slot="description">${value?.description}</span>
|
||||
|
@ -20,9 +20,8 @@ export class DemoHaTip extends LitElement {
|
||||
<ha-card header="ha-tip ${mode} demo">
|
||||
<div class="card-content">
|
||||
${tips.map(
|
||||
(tip) => html`<ha-tip .hass=${provideHass(this)}
|
||||
>${tip}</ha-tip
|
||||
>`
|
||||
(tip) =>
|
||||
html`<ha-tip .hass=${provideHass(this)}>${tip}</ha-tip>`
|
||||
)}
|
||||
</div>
|
||||
</ha-card>
|
||||
|
@ -544,8 +544,7 @@ class HassioAddonInfo extends LitElement {
|
||||
<code slot="description"> ${this.addon.hostname} </code>
|
||||
</ha-settings-row>
|
||||
${metrics.map(
|
||||
(metric) =>
|
||||
html`
|
||||
(metric) => html`
|
||||
<supervisor-metric
|
||||
.description=${metric.description}
|
||||
.value=${metric.value ?? 0}
|
||||
|
@ -384,7 +384,8 @@ export class SupervisorBackupContent extends LitElement {
|
||||
: undefined;
|
||||
let checkedItems = 0;
|
||||
this[section].forEach((item) => {
|
||||
templates.push(html`<ha-formfield
|
||||
templates.push(
|
||||
html`<ha-formfield
|
||||
.label=${html`<supervisor-formfield-label
|
||||
.label=${item.name}
|
||||
.iconPath=${section === "addons" ? mdiPuzzle : mdiFolder}
|
||||
@ -405,7 +406,8 @@ export class SupervisorBackupContent extends LitElement {
|
||||
@change=${this._updateSectionEntry}
|
||||
>
|
||||
</ha-checkbox>
|
||||
</ha-formfield>`);
|
||||
</ha-formfield>`
|
||||
);
|
||||
|
||||
if (item.checked) {
|
||||
checkedItems++;
|
||||
|
@ -168,8 +168,7 @@ export class DialogHassioNetwork
|
||||
${this._accessPoints.accesspoints
|
||||
.filter((ap) => ap.ssid)
|
||||
.map(
|
||||
(ap) =>
|
||||
html`
|
||||
(ap) => html`
|
||||
<mwc-list-item
|
||||
twoline
|
||||
@click=${this._selectAP}
|
||||
|
@ -157,7 +157,8 @@ class HassioRegistriesDialog extends LitElement {
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -209,7 +209,8 @@ class HassioRepositoriesDialog extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -81,8 +81,7 @@ class HassioCoreInfo extends LitElement {
|
||||
</div>
|
||||
<div>
|
||||
${metrics.map(
|
||||
(metric) =>
|
||||
html`
|
||||
(metric) => html`
|
||||
<supervisor-metric
|
||||
.description=${metric.description}
|
||||
.value=${metric.value ?? 0}
|
||||
|
@ -154,8 +154,7 @@ class HassioHostInfo extends LitElement {
|
||||
</ha-settings-row>`
|
||||
: ""}
|
||||
${metrics.map(
|
||||
(metric) =>
|
||||
html`
|
||||
(metric) => html`
|
||||
<supervisor-metric
|
||||
.description=${metric.description}
|
||||
.value=${metric.value ?? 0}
|
||||
|
@ -178,8 +178,7 @@ class HassioSupervisorInfo extends LitElement {
|
||||
</div>
|
||||
<div class="metrics-block">
|
||||
${metrics.map(
|
||||
(metric) =>
|
||||
html`
|
||||
(metric) => html`
|
||||
<supervisor-metric
|
||||
.description=${metric.description}
|
||||
.value=${metric.value ?? 0}
|
||||
|
@ -227,7 +227,7 @@
|
||||
"object-hash": "3.0.0",
|
||||
"open": "9.1.0",
|
||||
"pinst": "3.0.0",
|
||||
"prettier": "2.8.8",
|
||||
"prettier": "3.0.0",
|
||||
"rollup": "2.79.1",
|
||||
"rollup-plugin-string": "3.0.0",
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
|
3
prettier.config.js
Normal file
3
prettier.config.js
Normal file
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
trailingComma: "es5",
|
||||
};
|
@ -38,7 +38,7 @@ export type LocalizeKeys =
|
||||
// Tweaked from https://www.raygesualdo.com/posts/flattening-object-keys-with-typescript-types
|
||||
export type FlattenObjectKeys<
|
||||
T extends Record<string, any>,
|
||||
Key extends keyof T = keyof T
|
||||
Key extends keyof T = keyof T,
|
||||
> = Key extends string
|
||||
? T[Key] extends Record<string, unknown>
|
||||
? `${Key}.${FlattenObjectKeys<T[Key]>}`
|
||||
|
@ -108,7 +108,8 @@ export default class HaChartBase extends LitElement {
|
||||
? html`<div class="chartLegend">
|
||||
<ul>
|
||||
${this.data.datasets.map(
|
||||
(dataset, index) => html`<li
|
||||
(dataset, index) =>
|
||||
html`<li
|
||||
.datasetIndex=${index}
|
||||
@click=${this._legendClick}
|
||||
class=${classMap({
|
||||
@ -156,7 +157,8 @@ export default class HaChartBase extends LitElement {
|
||||
<div>
|
||||
<ul>
|
||||
${this._tooltip.body.map(
|
||||
(item, i) => html`<li>
|
||||
(item, i) =>
|
||||
html`<li>
|
||||
<div
|
||||
class="bullet"
|
||||
style=${styleMap({
|
||||
|
@ -36,12 +36,11 @@ interface AreaDevices {
|
||||
devices: string[];
|
||||
}
|
||||
|
||||
const rowRenderer: ComboBoxLitRenderer<AreaDevices> = (
|
||||
item
|
||||
) => html`<mwc-list-item twoline>
|
||||
const rowRenderer: ComboBoxLitRenderer<AreaDevices> = (item) =>
|
||||
html`<mwc-list-item twoline>
|
||||
<span>${item.name}</span>
|
||||
<span slot="secondary">${item.devices.length} devices</span>
|
||||
</mwc-list-item>`;
|
||||
</mwc-list-item>`;
|
||||
|
||||
@customElement("ha-area-devices-picker")
|
||||
export class HaAreaDevicesPicker extends SubscribeMixin(LitElement) {
|
||||
|
@ -17,7 +17,7 @@ const NO_AUTOMATION_KEY = "NO_AUTOMATION";
|
||||
const UNKNOWN_AUTOMATION_KEY = "UNKNOWN_AUTOMATION";
|
||||
|
||||
export abstract class HaDeviceAutomationPicker<
|
||||
T extends DeviceAutomation
|
||||
T extends DeviceAutomation,
|
||||
> extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
|
@ -45,12 +45,11 @@ export type HaDevicePickerDeviceFilterFunc = (
|
||||
|
||||
export type HaDevicePickerEntityFilterFunc = (entity: HassEntity) => boolean;
|
||||
|
||||
const rowRenderer: ComboBoxLitRenderer<Device> = (item) => html`<mwc-list-item
|
||||
.twoline=${!!item.area}
|
||||
>
|
||||
const rowRenderer: ComboBoxLitRenderer<Device> = (item) =>
|
||||
html`<mwc-list-item .twoline=${!!item.area}>
|
||||
<span>${item.name}</span>
|
||||
<span slot="secondary">${item.area}</span>
|
||||
</mwc-list-item>`;
|
||||
</mwc-list-item>`;
|
||||
|
||||
@customElement("ha-device-picker")
|
||||
export class HaDevicePicker extends SubscribeMixin(LitElement) {
|
||||
|
@ -87,11 +87,13 @@ export class HaStatisticPicker extends LitElement {
|
||||
|
||||
private _statistics: StatisticItem[] = [];
|
||||
|
||||
private _rowRenderer: ComboBoxLitRenderer<StatisticItem> = (
|
||||
item
|
||||
) => html`<mwc-list-item graphic="avatar" twoline>
|
||||
private _rowRenderer: ComboBoxLitRenderer<StatisticItem> = (item) =>
|
||||
html`<mwc-list-item graphic="avatar" twoline>
|
||||
${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 slot="secondary"
|
||||
|
@ -211,7 +211,9 @@ export class StateBadge extends LitElement {
|
||||
background: var(--divider-color);
|
||||
}
|
||||
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 {
|
||||
color: #fce588;
|
||||
|
@ -11,9 +11,8 @@ import "./ha-combo-box";
|
||||
import type { HaComboBox } from "./ha-combo-box";
|
||||
import "./ha-list-item";
|
||||
|
||||
const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (
|
||||
item
|
||||
) => html`<ha-list-item twoline graphic="icon">
|
||||
const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (item) =>
|
||||
html`<ha-list-item twoline graphic="icon">
|
||||
<span>${item.name}</span>
|
||||
<span slot="secondary">${item.slug}</span>
|
||||
${item.icon
|
||||
@ -23,7 +22,7 @@ const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (
|
||||
.src="/api/hassio/addons/${item.slug}/icon"
|
||||
/>`
|
||||
: ""}
|
||||
</ha-list-item>`;
|
||||
</ha-list-item>`;
|
||||
|
||||
@customElement("ha-addon-picker")
|
||||
class HaAddonPicker extends LitElement {
|
||||
|
@ -53,8 +53,7 @@ export class HaAnalytics extends LitElement {
|
||||
</ha-switch>
|
||||
</ha-settings-row>
|
||||
${ADDITIONAL_PREFERENCES.map(
|
||||
(preference) =>
|
||||
html`
|
||||
(preference) => html`
|
||||
<ha-settings-row>
|
||||
<span slot="heading" data-for=${preference}>
|
||||
${this.localize(
|
||||
|
@ -34,13 +34,12 @@ import "./ha-svg-icon";
|
||||
|
||||
type ScorableAreaRegistryEntry = ScorableTextItem & AreaRegistryEntry;
|
||||
|
||||
const rowRenderer: ComboBoxLitRenderer<AreaRegistryEntry> = (
|
||||
item
|
||||
) => html`<mwc-list-item
|
||||
const rowRenderer: ComboBoxLitRenderer<AreaRegistryEntry> = (item) =>
|
||||
html`<mwc-list-item
|
||||
class=${classMap({ "add-new": item.area_id === "add_new" })}
|
||||
>
|
||||
>
|
||||
${item.name}
|
||||
</mwc-list-item>`;
|
||||
</mwc-list-item>`;
|
||||
|
||||
@customElement("ha-area-picker")
|
||||
export class HaAreaPicker extends LitElement {
|
||||
|
@ -94,7 +94,9 @@ export class HaButtonToggleGroup extends LitElement {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
content: "";
|
||||
transition: opacity 15ms linear, background-color 15ms linear;
|
||||
transition:
|
||||
opacity 15ms linear,
|
||||
background-color 15ms linear;
|
||||
}
|
||||
ha-icon-button[active]::before,
|
||||
mwc-button[active]::before {
|
||||
|
@ -47,9 +47,8 @@ class HaConfigEntryPicker extends LitElement {
|
||||
this._getConfigEntries();
|
||||
}
|
||||
|
||||
private _rowRenderer: ComboBoxLitRenderer<ConfigEntryExtended> = (
|
||||
item
|
||||
) => html`<mwc-list-item twoline graphic="icon">
|
||||
private _rowRenderer: ComboBoxLitRenderer<ConfigEntryExtended> = (item) =>
|
||||
html`<mwc-list-item twoline graphic="icon">
|
||||
<span
|
||||
>${item.title ||
|
||||
this.hass.localize(
|
||||
|
@ -122,7 +122,8 @@ export class HaControlButton extends LitElement {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
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: var(--control-button-background-opacity);
|
||||
}
|
||||
|
@ -566,7 +566,9 @@ export class HaControlCircularSlider extends LitElement {
|
||||
fill: none;
|
||||
stroke: var(--control-circular-slider-background);
|
||||
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-width: 24px;
|
||||
}
|
||||
@ -576,9 +578,11 @@ export class HaControlCircularSlider extends LitElement {
|
||||
fill: none;
|
||||
stroke-linecap: round;
|
||||
stroke-width: 24px;
|
||||
transition: stroke-width 300ms ease-in-out,
|
||||
transition:
|
||||
stroke-width 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;
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,9 @@ export class HaControlSelect extends LitElement {
|
||||
width: 100%;
|
||||
background-color: var(--control-select-color);
|
||||
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:hover::before {
|
||||
|
@ -327,7 +327,8 @@ export class HaControlSlider extends LitElement {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: var(--control-slider-color);
|
||||
transition: transform 180ms ease-in-out,
|
||||
transition:
|
||||
transform 180ms ease-in-out,
|
||||
background-color 180ms ease-in-out;
|
||||
}
|
||||
.slider .slider-track-bar.show-handle {
|
||||
@ -427,7 +428,9 @@ export class HaControlSlider extends LitElement {
|
||||
position: absolute;
|
||||
background-color: white;
|
||||
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;
|
||||
bottom: 0;
|
||||
left: calc(var(--value, 0) * (100% - var(--cursor-size)));
|
||||
|
@ -208,7 +208,8 @@ export class HaControlSwitch extends LitElement {
|
||||
border-radius: calc(
|
||||
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: var(--control-switch-off-color);
|
||||
color: white;
|
||||
|
@ -55,8 +55,7 @@ export class HaFormGrid extends LitElement implements HaFormElement {
|
||||
protected render(): TemplateResult {
|
||||
return html`
|
||||
${this.schema.schema.map(
|
||||
(item) =>
|
||||
html`
|
||||
(item) => html`
|
||||
<ha-form
|
||||
.hass=${this.hass}
|
||||
.data=${this.data}
|
||||
|
@ -98,7 +98,7 @@ export interface HaFormTimeSchema extends HaFormBaseSchema {
|
||||
// Type utility to unionize a schema array by flattening any grid schemas
|
||||
export type SchemaUnion<
|
||||
SchemaArray extends readonly HaFormSchema[],
|
||||
Schema = SchemaArray[number]
|
||||
Schema = SchemaArray[number],
|
||||
> = Schema extends HaFormGridSchema | HaFormExpandableSchema
|
||||
? SchemaUnion<Schema["schema"]>
|
||||
: Schema;
|
||||
|
@ -406,7 +406,9 @@ class HaHsColorPicker extends LitElement {
|
||||
filter: url(#marker-shadow);
|
||||
}
|
||||
.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 {
|
||||
transition: transform 200ms ease-in-out;
|
||||
|
@ -81,11 +81,8 @@ class HaMountPicker extends LitElement {
|
||||
? dataDiskOption
|
||||
: nothing}
|
||||
${this._filterMounts(this._mounts, this.usage).map(
|
||||
(mount) => html`<ha-list-item
|
||||
twoline
|
||||
graphic="icon"
|
||||
.value=${mount.name}
|
||||
>
|
||||
(mount) =>
|
||||
html`<ha-list-item twoline graphic="icon" .value=${mount.name}>
|
||||
<span>${mount.name}</span>
|
||||
<span slot="secondary"
|
||||
>${mount.server}${mount.port
|
||||
|
@ -112,11 +112,10 @@ export class HaSelectSelector extends LitElement {
|
||||
${value?.length
|
||||
? html`<ha-chip-set>
|
||||
${value.map(
|
||||
(item, idx) =>
|
||||
html`
|
||||
(item, idx) => html`
|
||||
<ha-chip hasTrailingIcon>
|
||||
${options.find((option) => option.value === item)
|
||||
?.label || item}
|
||||
${options.find((option) => option.value === item)?.label ||
|
||||
item}
|
||||
<ha-svg-icon
|
||||
slot="trailing-icon"
|
||||
.path=${mdiClose}
|
||||
|
@ -10,12 +10,13 @@ import "./ha-combo-box";
|
||||
|
||||
const rowRenderer: ComboBoxLitRenderer<{ service: string; name: string }> = (
|
||||
item
|
||||
) => html`<mwc-list-item twoline>
|
||||
) =>
|
||||
html`<mwc-list-item twoline>
|
||||
<span>${item.name}</span>
|
||||
<span slot="secondary"
|
||||
>${item.name === item.service ? "" : item.service}</span
|
||||
>
|
||||
</mwc-list-item>`;
|
||||
</mwc-list-item>`;
|
||||
|
||||
@customElement("ha-service-picker")
|
||||
class HaServicePicker extends LitElement {
|
||||
|
@ -418,7 +418,9 @@ class HaTempColorPicker extends LitElement {
|
||||
filter: url(#marker-shadow);
|
||||
}
|
||||
.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 {
|
||||
transition: transform 200ms ease-in-out;
|
||||
|
@ -62,7 +62,8 @@ export class HaTTSVoicePicker extends LitElement {
|
||||
</ha-list-item>`
|
||||
: nothing}
|
||||
${this._voices.map(
|
||||
(voice) => html`<ha-list-item .value=${voice.voice_id}>
|
||||
(voice) =>
|
||||
html`<ha-list-item .value=${voice.voice_id}>
|
||||
${voice.name}
|
||||
</ha-list-item>`
|
||||
)}
|
||||
|
@ -930,7 +930,9 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||
margin-right: 16px;
|
||||
background-size: cover;
|
||||
border-radius: 2px;
|
||||
transition: width 0.4s, height 0.4s;
|
||||
transition:
|
||||
width 0.4s,
|
||||
height 0.4s;
|
||||
}
|
||||
.header-info {
|
||||
display: flex;
|
||||
@ -977,7 +979,9 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-bottom: 0;
|
||||
transition: height 0.5s, margin 0.5s;
|
||||
transition:
|
||||
height 0.5s,
|
||||
margin 0.5s;
|
||||
}
|
||||
|
||||
.not-shown {
|
||||
@ -1121,7 +1125,9 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||
top: auto;
|
||||
bottom: 0px;
|
||||
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 {
|
||||
@ -1220,7 +1226,10 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||
position: relative;
|
||||
background-position: center;
|
||||
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 {
|
||||
position: absolute;
|
||||
|
@ -40,7 +40,9 @@ class HaUsersPickerLight extends LitElement {
|
||||
|
||||
const notSelectedUsers = this._notSelectedUsers(this.users, this.value);
|
||||
return html`
|
||||
${guard([notSelectedUsers], () =>
|
||||
${guard(
|
||||
[notSelectedUsers],
|
||||
() =>
|
||||
this.value?.map(
|
||||
(user_id, idx) => html`
|
||||
<div>
|
||||
|
@ -13,7 +13,7 @@ interface InvalidConfig {
|
||||
type ValidKeys = "trigger" | "action" | "condition";
|
||||
|
||||
export const validateConfig = <
|
||||
T extends Partial<{ [key in ValidKeys]: unknown }>
|
||||
T extends Partial<{ [key in ValidKeys]: unknown }>,
|
||||
>(
|
||||
hass: HomeAssistant,
|
||||
config: T
|
||||
|
@ -14,7 +14,7 @@ declare global {
|
||||
export type ValidUserDataKey = keyof FrontendUserData;
|
||||
|
||||
export const fetchFrontendUserData = async <
|
||||
UserDataKey extends ValidUserDataKey
|
||||
UserDataKey extends ValidUserDataKey,
|
||||
>(
|
||||
conn: Connection,
|
||||
key: UserDataKey
|
||||
@ -29,7 +29,7 @@ export const fetchFrontendUserData = async <
|
||||
};
|
||||
|
||||
export const saveFrontendUserData = async <
|
||||
UserDataKey extends ValidUserDataKey
|
||||
UserDataKey extends ValidUserDataKey,
|
||||
>(
|
||||
conn: Connection,
|
||||
key: UserDataKey,
|
||||
@ -42,7 +42,7 @@ export const saveFrontendUserData = async <
|
||||
});
|
||||
|
||||
export const getOptimisticFrontendUserDataCollection = <
|
||||
UserDataKey extends ValidUserDataKey
|
||||
UserDataKey extends ValidUserDataKey,
|
||||
>(
|
||||
conn: Connection,
|
||||
userDataKey: UserDataKey
|
||||
|
@ -145,8 +145,7 @@ export interface DeviceSelector {
|
||||
}
|
||||
|
||||
export interface LegacyDeviceSelector {
|
||||
device:
|
||||
| DeviceSelector["device"] & {
|
||||
device: DeviceSelector["device"] & {
|
||||
/**
|
||||
* @deprecated Use filter instead
|
||||
*/
|
||||
@ -185,8 +184,7 @@ export interface EntitySelector {
|
||||
}
|
||||
|
||||
export interface LegacyEntitySelector {
|
||||
entity:
|
||||
| EntitySelector["entity"] & {
|
||||
entity: EntitySelector["entity"] & {
|
||||
/**
|
||||
* @deprecated Use filter instead
|
||||
*/
|
||||
|
@ -48,8 +48,7 @@ class StepFlowCreateEntry extends LitElement {
|
||||
</p>
|
||||
<div class="devices">
|
||||
${this.devices.map(
|
||||
(device) =>
|
||||
html`
|
||||
(device) => html`
|
||||
<div class="device">
|
||||
<div>
|
||||
<b>${computeDeviceName(device, this.hass)}</b><br />
|
||||
|
@ -150,8 +150,7 @@ class DialogLightColorFavorite extends LitElement {
|
||||
? html`
|
||||
<div class="modes">
|
||||
${this._modes.map(
|
||||
(value) =>
|
||||
html`
|
||||
(value) => html`
|
||||
<ha-icon-button-toggle
|
||||
border-only
|
||||
.selected=${value === this._mode}
|
||||
|
@ -415,7 +415,7 @@ class LightRgbColorPicker extends LitElement {
|
||||
number,
|
||||
number,
|
||||
number,
|
||||
number
|
||||
number,
|
||||
];
|
||||
this._applyColor({ rgbww_color });
|
||||
} else if (lightSupportsColorMode(this.stateObj!, LightColorMode.RGBW)) {
|
||||
@ -427,7 +427,7 @@ class LightRgbColorPicker extends LitElement {
|
||||
number,
|
||||
number,
|
||||
number,
|
||||
number
|
||||
number,
|
||||
];
|
||||
this._applyColor({ rgbw_color });
|
||||
}
|
||||
|
@ -36,7 +36,8 @@ export class MoreInfoConfigurator extends LitElement {
|
||||
</ha-alert>`
|
||||
: ""}
|
||||
${this.stateObj.attributes.fields.map(
|
||||
(field) => html`<ha-textfield
|
||||
(field) =>
|
||||
html`<ha-textfield
|
||||
.label=${field.name}
|
||||
.name=${field.id}
|
||||
.type=${field.type}
|
||||
|
@ -299,8 +299,7 @@ class MoreInfoFan extends LitElement {
|
||||
></ha-svg-icon>
|
||||
</ha-outlined-button>
|
||||
${this.stateObj.attributes.preset_modes?.map(
|
||||
(mode) =>
|
||||
html`
|
||||
(mode) => html`
|
||||
<ha-list-item
|
||||
.value=${mode}
|
||||
.activated=${this._presetMode === mode}
|
||||
|
@ -156,8 +156,7 @@ class MoreInfoMediaPlayer extends LitElement {
|
||||
@closed=${stopPropagation}
|
||||
>
|
||||
${stateObj.attributes.source_list!.map(
|
||||
(source) =>
|
||||
html`
|
||||
(source) => html`
|
||||
<mwc-list-item .value=${source}
|
||||
>${computeAttributeValueDisplay(
|
||||
this.hass.localize,
|
||||
|
@ -108,7 +108,8 @@ export class HuiNotificationDrawer extends LitElement {
|
||||
<div class="notifications">
|
||||
${notifications.length
|
||||
? html`${notifications.map(
|
||||
(notification) => html`<div class="notification">
|
||||
(notification) =>
|
||||
html`<div class="notification">
|
||||
<notification-item
|
||||
.hass=${this.hass}
|
||||
.notification=${notification}
|
||||
|
@ -158,7 +158,8 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||
></ha-svg-icon>
|
||||
</ha-button>
|
||||
${this._pipelines?.map(
|
||||
(pipeline) => html`<ha-list-item
|
||||
(pipeline) =>
|
||||
html`<ha-list-item
|
||||
?selected=${pipeline.id === this._pipelineId ||
|
||||
(!this._pipelineId &&
|
||||
pipeline.id === this._preferredPipeline)}
|
||||
@ -168,7 +169,10 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||
>
|
||||
${pipeline.name}${pipeline.id === this._preferredPipeline
|
||||
? html`
|
||||
<ha-svg-icon slot="meta" .path=${mdiStar}></ha-svg-icon>
|
||||
<ha-svg-icon
|
||||
slot="meta"
|
||||
.path=${mdiStar}
|
||||
></ha-svg-icon>
|
||||
`
|
||||
: nothing}
|
||||
</ha-list-item>`
|
||||
|
@ -94,8 +94,7 @@ class HassTabsSubpage extends LitElement {
|
||||
}
|
||||
|
||||
return shownTabs.map(
|
||||
(page) =>
|
||||
html`
|
||||
(page) => html`
|
||||
<a href=${page.path}>
|
||||
<ha-tab
|
||||
.hass=${this.hass}
|
||||
|
@ -79,8 +79,7 @@ class PanelCalendar extends LitElement {
|
||||
${this.hass.localize("ui.components.calendar.my_calendars")}
|
||||
</div>
|
||||
${this._calendars.map(
|
||||
(selCal) =>
|
||||
html`
|
||||
(selCal) => html`
|
||||
<div>
|
||||
<mwc-formfield .label=${selCal.name}>
|
||||
<mwc-checkbox
|
||||
|
@ -28,9 +28,10 @@ interface Domain {
|
||||
name: string;
|
||||
}
|
||||
|
||||
const rowRenderer: ComboBoxLitRenderer<Domain> = (item) => html`<mwc-list-item>
|
||||
const rowRenderer: ComboBoxLitRenderer<Domain> = (item) =>
|
||||
html`<mwc-list-item>
|
||||
<span>${item.name}</span>
|
||||
</mwc-list-item>`;
|
||||
</mwc-list-item>`;
|
||||
|
||||
@customElement("dialog-add-application-credential")
|
||||
export class DialogAddApplicationCredential extends LitElement {
|
||||
|
@ -283,8 +283,7 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) {
|
||||
.header=${this.hass.localize("ui.panel.config.devices.caption")}
|
||||
>${devices.length
|
||||
? devices.map(
|
||||
(device) =>
|
||||
html`
|
||||
(device) => html`
|
||||
<a href="/config/devices/device/${device.id}">
|
||||
<paper-item>
|
||||
<paper-item-body> ${device.name} </paper-item-body>
|
||||
|
@ -109,7 +109,8 @@ export class HaChooseAction extends LitElement implements ActionElement {
|
||||
|
||||
return html`
|
||||
${(action.choose ? ensureArray(action.choose) : []).map(
|
||||
(option, idx) => html`<ha-card>
|
||||
(option, idx) =>
|
||||
html`<ha-card>
|
||||
<ha-expansion-panel
|
||||
leftChevron
|
||||
@expanded-changed=${this._expandedChanged}
|
||||
|
@ -212,8 +212,7 @@ class HaAutomationPicker extends LitElement {
|
||||
title: "",
|
||||
width: this.narrow ? undefined : "10%",
|
||||
type: "overflow-menu",
|
||||
template: (_: string, automation: any) =>
|
||||
html`
|
||||
template: (_: string, automation: any) => html`
|
||||
<ha-icon-overflow-menu
|
||||
.hass=${this.hass}
|
||||
narrow
|
||||
|
@ -133,8 +133,7 @@ export class ThingTalkPlaceholders extends SubscribeMixin(LitElement) {
|
||||
<div>
|
||||
${this._error ? html` <div class="error">${this._error}</div> ` : ""}
|
||||
${Object.entries(this.placeholders).map(
|
||||
([type, placeholders]) =>
|
||||
html`
|
||||
([type, placeholders]) => html`
|
||||
<h3>
|
||||
${this.hass.localize(
|
||||
`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`
|
||||
)}<br />
|
||||
${placeholder.domains}<br />
|
||||
${placeholder.fields.map(
|
||||
(field) => html` ${field}<br /> `
|
||||
)}
|
||||
${placeholder.fields.map((field) => html` ${field}<br /> `)}
|
||||
</div>
|
||||
`;
|
||||
})}
|
||||
|
@ -125,8 +125,7 @@ class HaBlueprintOverview extends LitElement {
|
||||
direction: "asc",
|
||||
grows: true,
|
||||
template: narrow
|
||||
? (name, entity: any) =>
|
||||
html`
|
||||
? (name, entity: any) => html`
|
||||
${name}<br />
|
||||
<div class="secondary">${entity.path}</div>
|
||||
`
|
||||
|
@ -181,9 +181,8 @@ class HaConfigSystemNavigation extends LitElement {
|
||||
const hardwareInfo: HardwareInfo = await this.hass.callWS({
|
||||
type: "hardware/info",
|
||||
});
|
||||
this._boardName = hardwareInfo?.hardware.find(
|
||||
(hw) => hw.board !== null
|
||||
)?.name;
|
||||
this._boardName = hardwareInfo?.hardware.find((hw) => hw.board !== null)
|
||||
?.name;
|
||||
} else if (isHassioLoaded) {
|
||||
const osData: HassioHassOSInfo = await fetchHassioHassOsInfo(this.hass);
|
||||
if (osData.board) {
|
||||
|
@ -20,7 +20,7 @@ declare global {
|
||||
}
|
||||
|
||||
export abstract class HaDeviceAutomationCard<
|
||||
T extends DeviceAutomation
|
||||
T extends DeviceAutomation,
|
||||
> extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@ -76,8 +76,7 @@ export abstract class HaDeviceAutomationCard<
|
||||
<div class="content">
|
||||
<ha-chip-set>
|
||||
${automations.map(
|
||||
(automation, idx) =>
|
||||
html`
|
||||
(automation, idx) => html`
|
||||
<ha-chip
|
||||
.index=${idx}
|
||||
@click=${this._handleAutomationClicked}
|
||||
|
@ -376,8 +376,7 @@ export class HaConfigDevicePage extends LitElement {
|
||||
const firstDeviceAction = actions.shift();
|
||||
|
||||
if (device.disabled_by) {
|
||||
deviceInfo.push(
|
||||
html`
|
||||
deviceInfo.push(html`
|
||||
<ha-alert alert-type="warning">
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.devices.enabled_cause",
|
||||
@ -400,8 +399,7 @@ export class HaConfigDevicePage extends LitElement {
|
||||
</div>
|
||||
`
|
||||
: ""}
|
||||
`
|
||||
);
|
||||
`);
|
||||
}
|
||||
|
||||
this._renderIntegrationInfo(device, integrations, deviceInfo);
|
||||
@ -751,8 +749,7 @@ export class HaConfigDevicePage extends LitElement {
|
||||
? html`
|
||||
<div>
|
||||
${this._deviceAlerts.map(
|
||||
(alert) =>
|
||||
html`
|
||||
(alert) => html`
|
||||
<ha-alert .alertType=${alert.level}>
|
||||
${alert.text}
|
||||
</ha-alert>
|
||||
|
@ -76,8 +76,7 @@ export class EnergyBatterySettings extends LitElement {
|
||||
>
|
||||
</p>
|
||||
${batteryValidation.map(
|
||||
(result) =>
|
||||
html`
|
||||
(result) => html`
|
||||
<ha-energy-validation-result
|
||||
.hass=${this.hass}
|
||||
.issues=${result}
|
||||
|
@ -68,8 +68,7 @@ export class EnergyDeviceSettings extends LitElement {
|
||||
>
|
||||
</p>
|
||||
${this.validationResult?.device_consumption.map(
|
||||
(result) =>
|
||||
html`
|
||||
(result) => html`
|
||||
<ha-energy-validation-result
|
||||
.hass=${this.hass}
|
||||
.issues=${result}
|
||||
|
@ -74,8 +74,7 @@ export class EnergyGasSettings extends LitElement {
|
||||
>
|
||||
</p>
|
||||
${gasValidation.map(
|
||||
(result) =>
|
||||
html`
|
||||
(result) => html`
|
||||
<ha-energy-validation-result
|
||||
.hass=${this.hass}
|
||||
.issues=${result}
|
||||
|
@ -79,8 +79,7 @@ export class EnergySolarSettings extends LitElement {
|
||||
>
|
||||
</p>
|
||||
${solarValidation.map(
|
||||
(result) =>
|
||||
html`
|
||||
(result) => html`
|
||||
<ha-energy-validation-result
|
||||
.hass=${this.hass}
|
||||
.issues=${result}
|
||||
|
@ -75,8 +75,7 @@ export class EnergyWaterSettings extends LitElement {
|
||||
>
|
||||
</p>
|
||||
${waterValidation.map(
|
||||
(result) =>
|
||||
html`
|
||||
(result) => html`
|
||||
<ha-energy-validation-result
|
||||
.hass=${this.hass}
|
||||
.issues=${result}
|
||||
|
@ -139,7 +139,8 @@ export class DialogEnergySolarSettings
|
||||
${this._forecast
|
||||
? html`<div class="forecast-options">
|
||||
${this._configEntries?.map(
|
||||
(entry) => html`<ha-formfield
|
||||
(entry) =>
|
||||
html`<ha-formfield
|
||||
.label=${html`<div
|
||||
style="display: flex; align-items: center;"
|
||||
>
|
||||
|
@ -892,11 +892,9 @@ export class EntityRegistrySettingsEditor extends LitElement {
|
||||
"ui.dialogs.entity_registry.editor.use_device_area"
|
||||
)}
|
||||
${this.hass.devices[this.entry.device_id].area_id
|
||||
? `(${
|
||||
this.hass.areas[
|
||||
? `(${this.hass.areas[
|
||||
this.hass.devices[this.entry.device_id].area_id!
|
||||
]?.name
|
||||
})`
|
||||
]?.name})`
|
||||
: ""}</span
|
||||
>
|
||||
<span slot="description"
|
||||
|
@ -201,8 +201,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
|
||||
direction: "asc",
|
||||
grows: true,
|
||||
template: narrow
|
||||
? (name, entity: EntityRow) =>
|
||||
html`
|
||||
? (name, entity: EntityRow) => html`
|
||||
${name}<br />
|
||||
<div class="secondary">
|
||||
${entity.entity_id} |
|
||||
|
@ -110,8 +110,7 @@ class DialogHardwareAvailable extends LitElement implements HassDialog {
|
||||
</search-input>
|
||||
</div>
|
||||
${devices.map(
|
||||
(device) =>
|
||||
html`
|
||||
(device) => html`
|
||||
<ha-expansion-panel
|
||||
.header=${device.name}
|
||||
.secondary=${device.by_id || undefined}
|
||||
|
@ -53,7 +53,8 @@ class HaCounterForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -31,7 +31,8 @@ class HaInputBooleanForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -31,7 +31,8 @@ class HaInputButtonForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -45,7 +45,8 @@ class HaInputDateTimeForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -60,7 +60,8 @@ class HaInputNumberForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -43,7 +43,8 @@ class HaInputSelectForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -50,7 +50,8 @@ class HaInputTextForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -98,7 +98,8 @@ class HaScheduleForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -39,7 +39,8 @@ class HaTimerForm extends LitElement {
|
||||
}
|
||||
|
||||
public focus() {
|
||||
this.updateComplete.then(() =>
|
||||
this.updateComplete.then(
|
||||
() =>
|
||||
(
|
||||
this.shadowRoot?.querySelector("[dialogInitialFocus]") as HTMLElement
|
||||
)?.focus()
|
||||
|
@ -96,8 +96,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
|
||||
filterable: true,
|
||||
grows: true,
|
||||
direction: "asc",
|
||||
template: (name, item: any) =>
|
||||
html`
|
||||
template: (name, item: any) => html`
|
||||
${name}
|
||||
${narrow
|
||||
? html` <div class="secondary">${item.entity_id}</div> `
|
||||
|
@ -410,7 +410,8 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
|
||||
</h1>
|
||||
<mwc-list>
|
||||
${discoveryFlows.map(
|
||||
(flow) => html`<ha-list-item
|
||||
(flow) =>
|
||||
html`<ha-list-item
|
||||
hasMeta
|
||||
class="discovered"
|
||||
noninteractive
|
||||
|
@ -150,7 +150,7 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
|
||||
): [
|
||||
[string, ConfigEntryExtended[]][],
|
||||
ConfigEntryExtended[],
|
||||
ConfigEntryExtended[]
|
||||
ConfigEntryExtended[],
|
||||
] => {
|
||||
let filteredConfigEntries: ConfigEntryExtended[];
|
||||
const ignored: ConfigEntryExtended[] = [];
|
||||
|
@ -44,7 +44,8 @@ class HaDomainIntegrations extends LitElement {
|
||||
${this.hass.localize("ui.panel.config.integrations.discovered")}
|
||||
</h3>
|
||||
${this.flowsInProgress.map(
|
||||
(flow) => html`<mwc-list-item
|
||||
(flow) =>
|
||||
html`<mwc-list-item
|
||||
graphic="medium"
|
||||
.flow=${flow}
|
||||
@request-selected=${this._flowInProgressPicked}
|
||||
|
@ -223,7 +223,8 @@ class ZHAConfigDashboard extends LitElement {
|
||||
</ha-card>
|
||||
${this._configuration
|
||||
? Object.entries(this._configuration.schemas).map(
|
||||
([section, schema]) => html`<ha-card
|
||||
([section, schema]) =>
|
||||
html`<ha-card
|
||||
header=${this.hass.localize(
|
||||
`component.zha.config_panel.${section}.title`
|
||||
)}
|
||||
|
@ -94,8 +94,9 @@ export class ZHAGroupsDashboard extends LitElement {
|
||||
title: this.hass.localize("ui.panel.config.zha.groups.group_id"),
|
||||
type: "numeric",
|
||||
width: "15%",
|
||||
template: (groupId: number) =>
|
||||
html` ${formatAsPaddedHex(groupId)} `,
|
||||
template: (groupId: number) => html`
|
||||
${formatAsPaddedHex(groupId)}
|
||||
`,
|
||||
sortable: true,
|
||||
},
|
||||
members: {
|
||||
|
@ -228,7 +228,8 @@ class DialogZWaveJSAddNode extends LitElement {
|
||||
.sort()
|
||||
.reverse()
|
||||
.map(
|
||||
(securityClass) => html`<ha-formfield
|
||||
(securityClass) =>
|
||||
html`<ha-formfield
|
||||
.label=${html`<b
|
||||
>${this.hass.localize(
|
||||
`ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.title`
|
||||
|
@ -364,7 +364,7 @@ class DialogZWaveJSNodeStatistics extends LitElement {
|
||||
|
||||
const workingRoutesValueMap: [
|
||||
string,
|
||||
WorkingRouteStatistics | null | undefined
|
||||
WorkingRouteStatistics | null | undefined,
|
||||
][] = [
|
||||
["lwr", this._nodeStatistics?.lwr],
|
||||
["nlwr", this._nodeStatistics?.nlwr],
|
||||
|
@ -179,7 +179,8 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
|
||||
item.endpoint.toString()
|
||||
)
|
||||
).map(
|
||||
([endpoint, configParamEntries]) => html`<div class="content">
|
||||
([endpoint, configParamEntries]) =>
|
||||
html`<div class="content">
|
||||
<h3>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.zwave_js.node_config.endpoint",
|
||||
@ -195,7 +196,8 @@ class ZWaveJSNodeConfig extends SubscribeMixin(LitElement) {
|
||||
: paramA.property_key! - paramB.property_key!
|
||||
)
|
||||
.map(
|
||||
([id, item]) => html` <ha-settings-row
|
||||
([id, item]) =>
|
||||
html` <ha-settings-row
|
||||
class="config-item"
|
||||
.configId=${id}
|
||||
.narrow=${this.narrow}
|
||||
|
@ -123,8 +123,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
||||
sortable: true,
|
||||
filterable: true,
|
||||
width: "20%",
|
||||
template: (mode) =>
|
||||
html`
|
||||
template: (mode) => html`
|
||||
${this.hass.localize(
|
||||
`ui.panel.config.lovelace.dashboards.conf_mode.${mode}`
|
||||
) || mode}
|
||||
|
@ -58,8 +58,7 @@ export class HaConfigLovelaceRescources extends LitElement {
|
||||
sortable: true,
|
||||
filterable: true,
|
||||
width: "30%",
|
||||
template: (type) =>
|
||||
html`
|
||||
template: (type) => html`
|
||||
${this.hass.localize(
|
||||
`ui.panel.config.lovelace.resources.types.${type}`
|
||||
) || type}
|
||||
|
@ -139,8 +139,7 @@ export class HassioNetwork extends LitElement {
|
||||
${this._accessPoints.accesspoints
|
||||
.filter((ap) => ap.ssid)
|
||||
.map(
|
||||
(ap) =>
|
||||
html`
|
||||
(ap) => html`
|
||||
<mwc-list-item
|
||||
twoline
|
||||
@click=${this._selectAP}
|
||||
|
@ -305,13 +305,11 @@ class DialogSystemInformation extends LitElement {
|
||||
const sections: TemplateResult[] = [];
|
||||
|
||||
if (!this._systemInfo) {
|
||||
sections.push(
|
||||
html`
|
||||
sections.push(html`
|
||||
<div class="loading-container">
|
||||
<ha-circular-progress active></ha-circular-progress>
|
||||
</div>
|
||||
`
|
||||
);
|
||||
`);
|
||||
} else {
|
||||
const domains = Object.keys(this._systemInfo).sort(sortKeys);
|
||||
for (const domain of domains) {
|
||||
@ -371,8 +369,7 @@ class DialogSystemInformation extends LitElement {
|
||||
`);
|
||||
}
|
||||
if (domain !== "homeassistant") {
|
||||
sections.push(
|
||||
html`
|
||||
sections.push(html`
|
||||
<div class="card-header">
|
||||
<h3>${domainToName(this.hass.localize, domain)}</h3>
|
||||
${!domainInfo.manage_url
|
||||
@ -387,8 +384,7 @@ class DialogSystemInformation extends LitElement {
|
||||
</a>
|
||||
`}
|
||||
</div>
|
||||
`
|
||||
);
|
||||
`);
|
||||
}
|
||||
sections.push(html`
|
||||
<table>
|
||||
|
@ -90,8 +90,9 @@ class HaSceneDashboard extends LitElement {
|
||||
"ui.panel.config.scene.picker.headers.state"
|
||||
),
|
||||
type: "icon",
|
||||
template: (_, scene) =>
|
||||
html` <ha-state-icon .state=${scene}></ha-state-icon> `,
|
||||
template: (_, scene) => html`
|
||||
<ha-state-icon .state=${scene}></ha-state-icon>
|
||||
`,
|
||||
},
|
||||
name: {
|
||||
title: this.hass.localize(
|
||||
@ -151,8 +152,7 @@ class HaSceneDashboard extends LitElement {
|
||||
title: "",
|
||||
width: "72px",
|
||||
type: "overflow-menu",
|
||||
template: (_: string, scene: any) =>
|
||||
html`
|
||||
template: (_: string, scene: any) => html`
|
||||
<ha-icon-overflow-menu
|
||||
.hass=${this.hass}
|
||||
narrow
|
||||
|
@ -324,8 +324,7 @@ export class HaSceneEditor extends SubscribeMixin(
|
||||
</div>
|
||||
|
||||
${devices.map(
|
||||
(device) =>
|
||||
html`
|
||||
(device) => html`
|
||||
<ha-card outlined>
|
||||
<h1 class="card-header">
|
||||
${device.name}
|
||||
|
@ -165,8 +165,7 @@ class HaScriptPicker extends LitElement {
|
||||
title: "",
|
||||
width: this.narrow ? undefined : "10%",
|
||||
type: "overflow-menu",
|
||||
template: (_: string, script: any) =>
|
||||
html`
|
||||
template: (_: string, script: any) => html`
|
||||
<ha-icon-overflow-menu
|
||||
.hass=${this.hass}
|
||||
narrow
|
||||
@ -201,9 +200,7 @@ class HaScriptPicker extends LitElement {
|
||||
action: () => this._duplicate(script),
|
||||
},
|
||||
{
|
||||
label: this.hass.localize(
|
||||
"ui.panel.config.script.picker.delete"
|
||||
),
|
||||
label: this.hass.localize("ui.panel.config.script.picker.delete"),
|
||||
path: mdiDelete,
|
||||
action: () => this._deleteConfirm(script),
|
||||
warning: true,
|
||||
|
@ -70,7 +70,8 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
||||
sortable: true,
|
||||
filterable: true,
|
||||
grows: true,
|
||||
template: (name, tag: any) => html`${name}
|
||||
template: (name, tag: any) =>
|
||||
html`${name}
|
||||
${narrow
|
||||
? html`<div class="secondary">
|
||||
${tag.last_scanned_datetime
|
||||
@ -106,7 +107,8 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
||||
title: "",
|
||||
label: this.hass.localize("ui.panel.config.tag.headers.write"),
|
||||
type: "icon-button",
|
||||
template: (_write, tag: any) => html` <ha-icon-button
|
||||
template: (_write, tag: any) =>
|
||||
html` <ha-icon-button
|
||||
.tag=${tag}
|
||||
@click=${this._handleWriteClick}
|
||||
.label=${this.hass.localize("ui.panel.config.tag.write")}
|
||||
@ -117,17 +119,21 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
||||
columns.automation = {
|
||||
title: "",
|
||||
type: "icon-button",
|
||||
template: (_automation, tag: any) => html` <ha-icon-button
|
||||
template: (_automation, tag: any) =>
|
||||
html` <ha-icon-button
|
||||
.tag=${tag}
|
||||
@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}
|
||||
></ha-icon-button>`,
|
||||
};
|
||||
columns.edit = {
|
||||
title: "",
|
||||
type: "icon-button",
|
||||
template: (_settings, tag: any) => html` <ha-icon-button
|
||||
template: (_settings, tag: any) =>
|
||||
html` <ha-icon-button
|
||||
.tag=${tag}
|
||||
@click=${this._handleEditClick}
|
||||
.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
Loading…
x
Reference in New Issue
Block a user