Update dependency prettier to v3.1.0 (#18675)

* Update dependency prettier to v3.1.0

* 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:
renovate[bot] 2023-11-19 23:31:56 -05:00 committed by GitHub
parent 6e66ba202f
commit 15395275ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
146 changed files with 2733 additions and 2648 deletions

View File

@ -30,8 +30,8 @@ gulp.task(
env.useWDS()
? "wds-watch-app"
: env.useRollup()
? "rollup-watch-app"
: "webpack-watch-app"
? "rollup-watch-app"
: "webpack-watch-app"
)
);

View File

@ -51,8 +51,8 @@ const createWebpackConfig = ({
devtool: isTestBuild
? false
: isProdBuild
? "nosources-source-map"
: "eval-cheap-module-source-map",
? "nosources-source-map"
: "eval-cheap-module-source-map",
entry,
node: false,
module: {

View File

@ -73,44 +73,44 @@ class HcCast extends LitElement {
${error
? html` <div class="card-content">${error}</div> `
: !this.castManager.status
? html`
<p class="center-item">
<mwc-button raised @click=${this._handleLaunch}>
<ha-svg-icon .path=${mdiCast}></ha-svg-icon>
Start Casting
</mwc-button>
</p>
`
: html`
<div class="section-header">PICK A VIEW</div>
<paper-listbox
attr-for-selected="data-path"
.selected=${this.castManager.status.lovelacePath || ""}
>
${(
this.lovelaceViews ?? [
generateDefaultViewConfig({}, {}, {}, {}, () => ""),
]
).map(
(view, idx) => html`
<paper-icon-item
@click=${this._handlePickView}
data-path=${view.path || idx}
>
${view.icon
? html`
<ha-icon
.icon=${view.icon}
slot="item-icon"
></ha-icon>
`
: ""}
${view.title || view.path}
</paper-icon-item>
`
)}
</paper-listbox>
`}
? html`
<p class="center-item">
<mwc-button raised @click=${this._handleLaunch}>
<ha-svg-icon .path=${mdiCast}></ha-svg-icon>
Start Casting
</mwc-button>
</p>
`
: html`
<div class="section-header">PICK A VIEW</div>
<paper-listbox
attr-for-selected="data-path"
.selected=${this.castManager.status.lovelacePath || ""}
>
${(
this.lovelaceViews ?? [
generateDefaultViewConfig({}, {}, {}, {}, () => ""),
]
).map(
(view, idx) => html`
<paper-icon-item
@click=${this._handlePickView}
data-path=${view.path || idx}
>
${view.icon
? html`
<ha-icon
.icon=${view.icon}
slot="item-icon"
></ha-icon>
`
: ""}
${view.title || view.path}
</paper-icon-item>
`
)}
</paper-listbox>
`}
<div class="card-actions">
${this.castManager.status
? html`

View File

@ -33,13 +33,13 @@ const translateErr = (err) =>
err === ERR_CANNOT_CONNECT
? "Unable to connect"
: err === ERR_HASS_HOST_REQUIRED
? "Please enter a Home Assistant URL."
: err === ERR_INVALID_HTTPS_TO_HTTP
? html`
Cannot connect to Home Assistant instances over "http://".
${seeFAQ("https")}
`
: `Unknown error (${err}).`;
? "Please enter a Home Assistant URL."
: err === ERR_INVALID_HTTPS_TO_HTTP
? html`
Cannot connect to Home Assistant instances over "http://".
${seeFAQ("https")}
`
: `Unknown error (${err}).`;
const INTRO = html`
<p>

View File

@ -43,8 +43,8 @@ const generateMeanStatistics = (
period === "day"
? addDays(currentDate, 1)
: period === "month"
? addMonths(currentDate, 1)
: addHours(currentDate, 1);
? addMonths(currentDate, 1)
: addHours(currentDate, 1);
}
return statistics;
};
@ -80,8 +80,8 @@ const generateSumStatistics = (
period === "day"
? addDays(currentDate, 1)
: period === "month"
? addMonths(currentDate, 1)
: addHours(currentDate, 1);
? addMonths(currentDate, 1)
: addHours(currentDate, 1);
}
return statistics;
};

View File

@ -86,15 +86,15 @@ export class HassioAddonRepositoryEl extends LitElement {
)
: this.supervisor.localize("addon.state.installed")
: addon.available
? this.supervisor.localize("addon.state.not_installed")
: this.supervisor.localize("addon.state.not_available")}
? this.supervisor.localize("addon.state.not_installed")
: this.supervisor.localize("addon.state.not_available")}
.iconClass=${addon.installed
? addon.update_available
? "update"
: "installed"
: !addon.available
? "not_available"
: ""}
? "not_available"
: ""}
.iconImage=${atLeastVersion(
this.hass.config.version,
0,
@ -108,8 +108,8 @@ export class HassioAddonRepositoryEl extends LitElement {
? "update"
: "installed"
: !addon.available
? "unavailable"
: ""}
? "unavailable"
: ""}
></hassio-card-content>
</div>
</ha-card>

View File

@ -104,50 +104,50 @@ class HassioAddonConfig extends LitElement {
selector: { select: { options: entry.options } },
}
: entry.type === "string"
? entry.multiple
? {
name: entry.name,
required: entry.required,
selector: {
select: { options: [], multiple: true, custom_value: true },
},
}
: {
name: entry.name,
required: entry.required,
selector: {
text: {
type:
entry.format || MASKED_FIELDS.includes(entry.name)
? "password"
: "text",
? entry.multiple
? {
name: entry.name,
required: entry.required,
selector: {
select: { options: [], multiple: true, custom_value: true },
},
},
}
: entry.type === "boolean"
? {
name: entry.name,
required: entry.required,
selector: { boolean: {} },
}
: entry.type === "schema"
? {
name: entry.name,
required: entry.required,
selector: { object: {} },
}
: entry.type === "float" || entry.type === "integer"
? {
name: entry.name,
required: entry.required,
selector: {
number: {
mode: "box",
step: entry.type === "float" ? "any" : undefined,
},
},
}
: entry
}
: {
name: entry.name,
required: entry.required,
selector: {
text: {
type:
entry.format || MASKED_FIELDS.includes(entry.name)
? "password"
: "text",
},
},
}
: entry.type === "boolean"
? {
name: entry.name,
required: entry.required,
selector: { boolean: {} },
}
: entry.type === "schema"
? {
name: entry.name,
required: entry.required,
selector: { object: {} },
}
: entry.type === "float" || entry.type === "integer"
? {
name: entry.name,
required: entry.required,
selector: {
number: {
mode: "box",
step: entry.type === "float" ? "any" : undefined,
},
},
}
: entry
)
);

View File

@ -17,8 +17,11 @@ class SupervisorFormfieldLabel extends LitElement {
${this.imageUrl
? html`<img loading="lazy" alt="" src=${this.imageUrl} class="icon" />`
: this.iconPath
? html`<ha-svg-icon .path=${this.iconPath} class="icon"></ha-svg-icon>`
: ""}
? html`<ha-svg-icon
.path=${this.iconPath}
class="icon"
></ha-svg-icon>`
: ""}
<span class="label">${this.label}</span>
${this.version
? html`<span class="version">(${this.version})</span>`

View File

@ -68,17 +68,19 @@ class HassioAddons extends LitElement {
.iconTitle=${addon.state !== "started"
? this.supervisor.localize("dashboard.addon_stopped")
: addon.update_available!
? this.supervisor.localize(
"dashboard.addon_new_version"
)
: this.supervisor.localize("dashboard.addon_running")}
? this.supervisor.localize(
"dashboard.addon_new_version"
)
: this.supervisor.localize(
"dashboard.addon_running"
)}
.iconClass=${addon.update_available
? addon.state === "started"
? "update"
: "update stopped"
: addon.state === "started"
? "running"
: "stopped"}
? "running"
: "stopped"}
.iconImage=${atLeastVersion(
this.hass.config.version,
0,

View File

@ -105,12 +105,12 @@ class HassioDatadiskDialog extends LitElement {
</ha-select>
`
: this.devices === undefined
? this.dialogParams.supervisor.localize(
"dialog.datadisk_move.loading_devices"
)
: this.dialogParams.supervisor.localize(
"dialog.datadisk_move.no_devices"
)}
? this.dialogParams.supervisor.localize(
"dialog.datadisk_move.loading_devices"
)
: this.dialogParams.supervisor.localize(
"dialog.datadisk_move.no_devices"
)}
<mwc-button
slot="secondaryAction"

View File

@ -67,8 +67,8 @@ class HassioRouter extends HassRouterPage {
const route = hassioPanel
? this.route
: ingressPanel && this.panel.config?.ingress
? this._ingressRoute(this.panel.config?.ingress)
: this.routeTail;
? this._ingressRoute(this.panel.config?.ingress)
: this.routeTail;
el.hass = this.hass;
el.narrow = this.narrow;

View File

@ -109,19 +109,19 @@ class HassioSupervisorInfo extends LitElement {
</ha-progress-button>
`
: this.supervisor.supervisor.channel === "stable"
? html`
<ha-progress-button
@click=${this._toggleBeta}
.title=${this.supervisor.localize(
"system.supervisor.join_beta_description"
)}
>
${this.supervisor.localize(
"system.supervisor.join_beta_action"
)}
</ha-progress-button>
`
: ""}
? html`
<ha-progress-button
@click=${this._toggleBeta}
.title=${this.supervisor.localize(
"system.supervisor.join_beta_description"
)}
>
${this.supervisor.localize(
"system.supervisor.join_beta_action"
)}
</ha-progress-button>
`
: ""}
</ha-settings-row>
${this.supervisor.supervisor.supported

View File

@ -70,8 +70,8 @@ const changelogUrl = (
return version.includes("dev")
? "https://github.com/home-assistant/core/commits/dev"
: version.includes("b")
? "https://next.home-assistant.io/latest-release-notes/"
: "https://www.home-assistant.io/latest-release-notes/";
? "https://next.home-assistant.io/latest-release-notes/"
: "https://www.home-assistant.io/latest-release-notes/";
}
if (entry === "os") {
return version.includes("dev")
@ -141,44 +141,47 @@ class UpdateAvailableCard extends LitElement {
})}
</p>`
: !this._updating
? html`
${this._changelogContent
? html`
<ha-faded>
<ha-markdown .content=${this._changelogContent}>
</ha-markdown>
</ha-faded>
`
: ""}
<div class="versions">
<p>
${this.supervisor.localize("update_available.description", {
? html`
${this._changelogContent
? html`
<ha-faded>
<ha-markdown .content=${this._changelogContent}>
</ha-markdown>
</ha-faded>
`
: ""}
<div class="versions">
<p>
${this.supervisor.localize(
"update_available.description",
{
name: this._name,
version: this._version,
newest_version: this._version_latest,
}
)}
</p>
</div>
${["core", "addon"].includes(this._updateType)
? html`
<ha-formfield
.label=${this.supervisor.localize(
"update_available.create_backup"
)}
>
<ha-checkbox checked></ha-checkbox>
</ha-formfield>
`
: ""}
`
: html`<ha-circular-progress alt="Updating" size="large" active>
</ha-circular-progress>
<p class="progress-text">
${this.supervisor.localize("update_available.updating", {
name: this._name,
version: this._version,
newest_version: this._version_latest,
version: this._version_latest,
})}
</p>
</div>
${["core", "addon"].includes(this._updateType)
? html`
<ha-formfield
.label=${this.supervisor.localize(
"update_available.create_backup"
)}
>
<ha-checkbox checked></ha-checkbox>
</ha-formfield>
`
: ""}
`
: html`<ha-circular-progress alt="Updating" size="large" active>
</ha-circular-progress>
<p class="progress-text">
${this.supervisor.localize("update_available.updating", {
name: this._name,
version: this._version_latest,
})}
</p>`}
</p>`}
</div>
${this._version !== this._version_latest && !this._updating
? html`

View File

@ -229,7 +229,7 @@
"object-hash": "3.0.0",
"open": "9.1.0",
"pinst": "3.0.0",
"prettier": "3.0.3",
"prettier": "3.1.0",
"rollup": "2.79.1",
"rollup-plugin-string": "3.0.0",
"rollup-plugin-terser": "7.0.2",

View File

@ -41,8 +41,8 @@ export class HaAuthFormString extends HaFormString {
!this.isPassword
? this.stringType
: this.unmaskedPassword
? "text"
: "password"
? "text"
: "password"
}
.label=${this.label}
.value=${this.data || ""}

View File

@ -10,10 +10,10 @@ const isLoadedIntegration = (hass: HomeAssistant, page: PageNavigation) =>
page.component
? isComponentLoaded(hass, page.component)
: page.components
? page.components.some((integration) =>
isComponentLoaded(hass, integration)
)
: true;
? page.components.some((integration) =>
isComponentLoaded(hass, integration)
)
: true;
const isCore = (page: PageNavigation) => page.core;
const isAdvancedPage = (page: PageNavigation) => page.advancedOnly;
const userWantsAdvanced = (hass: HomeAssistant) => hass.userData?.showAdvanced;

View File

@ -4,5 +4,5 @@ export const mainWindow =
window.name === MAIN_WINDOW_NAME
? window
: parent.name === MAIN_WINDOW_NAME
? parent
: top!;
? parent
: top!;

View File

@ -225,8 +225,8 @@ export const computeStateDisplayFromEntityAttributes = (
: localize("ui.card.update.installing")
: attributes.latest_version
: attributes.skipped_version === attributes.latest_version
? attributes.latest_version ?? localize("state.default.unavailable")
: localize("ui.card.update.up_to_date");
? attributes.latest_version ?? localize("state.default.unavailable")
: localize("ui.card.update.up_to_date");
}
return (

View File

@ -100,8 +100,8 @@ export const domainIconWithoutDefault = (
return compareState === "unavailable"
? mdiRobotConfused
: compareState === "off"
? mdiRobotOff
: mdiRobot;
? mdiRobotOff
: mdiRobot;
case "binary_sensor":
return binarySensorIcon(compareState, stateObj);

View File

@ -40,15 +40,15 @@ export class HaProgressButton extends LitElement {
${this._result === "success"
? html`<ha-svg-icon .path=${mdiCheckBold}></ha-svg-icon>`
: this._result === "error"
? html`<ha-svg-icon .path=${mdiAlertOctagram}></ha-svg-icon>`
: this.progress
? html`
<ha-circular-progress
size="small"
active
></ha-circular-progress>
`
: ""}
? html`<ha-svg-icon .path=${mdiAlertOctagram}></ha-svg-icon>`
: this.progress
? html`
<ha-circular-progress
size="small"
active
></ha-circular-progress>
`
: ""}
</div>
`}
`;

View File

@ -161,8 +161,8 @@ export class StateHistoryChartTimeline extends LitElement {
const yWidth = this.showNames
? y.width ?? 0
: computeRTL(this.hass)
? 0
: y.left ?? 0;
? 0
: y.left ?? 0;
if (
this._yWidth !== Math.floor(yWidth) &&
y.ticks.length === this.data.length

View File

@ -400,8 +400,8 @@ export class StatisticsChart extends LitElement {
? type === "min" && hasMean
? "+1"
: type === "max"
? "-1"
: false
? "-1"
: false
: false,
borderColor:
band && hasMean ? color + (this.hideLegend ? "00" : "7F") : color,

View File

@ -40,8 +40,8 @@ export class TextBarElement extends BarElement {
(options?.backgroundColor === "transparent"
? "transparent"
: luminosity(hex2rgb(options.backgroundColor)) > 0.5
? "#000"
: "#fff");
? "#000"
: "#fff");
// ctx.font = "12px arial";
ctx.fillStyle = textColor;

View File

@ -112,9 +112,9 @@ export class HaStateLabelBadge extends LitElement {
const image = this.icon
? ""
: this.image
? this.image
: entityState.attributes.entity_picture_local ||
entityState.attributes.entity_picture;
? this.image
: entityState.attributes.entity_picture_local ||
entityState.attributes.entity_picture;
const value =
!image && !showIcon
? this._computeValue(domain, entityState, entry)
@ -186,12 +186,12 @@ export class HaStateLabelBadge extends LitElement {
entityState.state === UNAVAILABLE
? "—"
: isNumericState(entityState)
? formatNumber(
entityState.state,
this.hass!.locale,
getNumberFormatOptions(entityState, entry)
)
: this.hass!.formatEntityState(entityState);
? formatNumber(
entityState.state,
this.hass!.locale,
getNumberFormatOptions(entityState, entry)
)
: this.hass!.formatEntityState(entityState);
}
}

View File

@ -85,8 +85,8 @@ export class HaCameraStream extends LitElement {
.src=${__DEMO__
? this.stateObj.attributes.entity_picture!
: this._connected
? computeMJPEGStreamUrl(this.stateObj)
: ""}
? computeMJPEGStreamUrl(this.stateObj)
: ""}
.alt=${`Preview of the ${computeStateName(this.stateObj)} camera.`}
/>`;
}

View File

@ -436,8 +436,8 @@ export class HaControlCircularSlider extends LitElement {
mode === "end"
? target <= current
: mode === "start"
? current <= target
: false;
? current <= target
: false;
const showTarget = value != null;
@ -453,8 +453,8 @@ export class HaControlCircularSlider extends LitElement {
mode === "full"
? this._strokeDashArc(this.min, this.max)
: mode === "end"
? this._strokeDashArc(target, limit)
: this._strokeDashArc(limit, target);
? this._strokeDashArc(target, limit)
: this._strokeDashArc(limit, target);
const targetCircle = showTarget
? this._strokeCircleDashArc(target)

View File

@ -129,8 +129,8 @@ export class HaControlSelectMenu extends SelectBase {
${icon && "path" in icon
? html`<ha-svg-icon .path=${icon.path}></ha-svg-icon>`
: icon && "icon" in icon
? html`<ha-icon .path=${icon.icon}></ha-icon>`
: html`<slot name="icon"></slot>`}
? html`<ha-icon .path=${icon.icon}></ha-icon>`
: html`<slot name="icon"></slot>`}
</div>
`;
}

View File

@ -184,8 +184,8 @@ export class HaControlSelect extends LitElement {
${option.path
? html`<ha-svg-icon .path=${option.path}></ha-svg-icon>`
: option.icon
? html`<ha-icon .icon=${option.icon}></ha-icon> `
: nothing}
? html`<ha-icon .icon=${option.icon}></ha-icon> `
: nothing}
${option.label && !this.hideLabel
? html`<span>${option.label}</span>`
: nothing}

View File

@ -147,8 +147,8 @@ export class HaControlSwitch extends LitElement {
? html`<ha-svg-icon .path=${this.pathOn}></ha-svg-icon>`
: html`<slot name="icon-on"></slot>`
: this.pathOff
? html`<ha-svg-icon .path=${this.pathOff}></ha-svg-icon>`
: html`<slot name="icon-off"></slot>`}
? html`<ha-svg-icon .path=${this.pathOff}></ha-svg-icon>`
: html`<slot name="icon-off"></slot>`}
</div>
</div>
`;

View File

@ -112,40 +112,40 @@ export class HaFileUpload extends LitElement {
>
<span class="supports">${this.supports}</span>`
: typeof this.value === "string"
? html`<div class="row">
<div class="value" @click=${this._openFilePicker}>
<ha-svg-icon
.path=${this.icon || mdiFileUpload}
></ha-svg-icon>
${this.value}
</div>
<ha-icon-button
@click=${this._clearValue}
.label=${this.hass?.localize("ui.common.delete") ||
"Delete"}
.path=${mdiDelete}
></ha-icon-button>
</div>`
: (this.value instanceof FileList
? Array.from(this.value)
: ensureArray(this.value)
).map(
(file) =>
html`<div class="row">
<div class="value" @click=${this._openFilePicker}>
<ha-svg-icon
.path=${this.icon || mdiFileUpload}
></ha-svg-icon>
${file.name} - ${bytesToString(file.size)}
</div>
<ha-icon-button
@click=${this._clearValue}
.label=${this.hass?.localize("ui.common.delete") ||
"Delete"}
.path=${mdiDelete}
></ha-icon-button>
</div>`
)}
? html`<div class="row">
<div class="value" @click=${this._openFilePicker}>
<ha-svg-icon
.path=${this.icon || mdiFileUpload}
></ha-svg-icon>
${this.value}
</div>
<ha-icon-button
@click=${this._clearValue}
.label=${this.hass?.localize("ui.common.delete") ||
"Delete"}
.path=${mdiDelete}
></ha-icon-button>
</div>`
: (this.value instanceof FileList
? Array.from(this.value)
: ensureArray(this.value)
).map(
(file) =>
html`<div class="row">
<div class="value" @click=${this._openFilePicker}>
<ha-svg-icon
.path=${this.icon || mdiFileUpload}
></ha-svg-icon>
${file.name} - ${bytesToString(file.size)}
</div>
<ha-icon-button
@click=${this._clearValue}
.label=${this.hass?.localize("ui.common.delete") ||
"Delete"}
.path=${mdiDelete}
></ha-icon-button>
</div>`
)}
<input
id="input"
type="file"

View File

@ -37,8 +37,10 @@ export class HaFormExpendable extends LitElement implements HaFormElement {
${this.schema.icon
? html` <ha-icon .icon=${this.schema.icon}></ha-icon> `
: this.schema.iconPath
? html` <ha-svg-icon .path=${this.schema.iconPath}></ha-svg-icon> `
: nothing}
? html`
<ha-svg-icon .path=${this.schema.iconPath}></ha-svg-icon>
`
: nothing}
${this.schema.title}
</div>
<div class="content">

View File

@ -53,8 +53,8 @@ export class HaFormString extends LitElement implements HaFormElement {
.type=${!this.isPassword
? this.stringType
: this.unmaskedPassword
? "text"
: "password"}
? "text"
: "password"}
.label=${this.label}
.value=${this.data || ""}
.helper=${this.helper}

View File

@ -115,12 +115,12 @@ export class HaForm extends LitElement implements HaFormElement {
</ha-alert>
`
: warning
? html`
<ha-alert own-margin alert-type="warning">
${this._computeWarning(warning, item)}
</ha-alert>
`
: ""}
? html`
<ha-alert own-margin alert-type="warning">
${this._computeWarning(warning, item)}
</ha-alert>
`
: ""}
${"selector" in item
? html`<ha-selector
.schema=${item}
@ -204,8 +204,8 @@ export class HaForm extends LitElement implements HaFormElement {
return this.computeLabel
? this.computeLabel(schema, data)
: schema
? schema.name
: "";
? schema.name
: "";
}
private _computeHelper(schema: HaFormSchema) {

View File

@ -141,8 +141,8 @@ export class Gauge extends LitElement {
this._segment_label
? ""
: this.label === "%"
? blankBeforePercent(this.locale) + "%"
: ` ${this.label}`
? blankBeforePercent(this.locale) + "%"
: ` ${this.label}`
}
</text>
</svg>`;

View File

@ -71,23 +71,23 @@ export class HaIconOverflowMenu extends LitElement {
item.narrowOnly
? ""
: item.divider
? html`<div role="separator"></div>`
: html`<div>
${item.tooltip
? html`<simple-tooltip
animation-delay="0"
position="left"
>
${item.tooltip}
</simple-tooltip>`
: ""}
<ha-icon-button
@click=${item.action}
.label=${item.label}
.path=${item.path}
?disabled=${item.disabled}
></ha-icon-button>
</div> `
? html`<div role="separator"></div>`
: html`<div>
${item.tooltip
? html`<simple-tooltip
animation-delay="0"
position="left"
>
${item.tooltip}
</simple-tooltip>`
: ""}
<ha-icon-button
@click=${item.action}
.label=${item.label}
.path=${item.path}
?disabled=${item.disabled}
></ha-icon-button>
</div> `
)}
`}
`;

View File

@ -120,11 +120,11 @@ export class HaIconPicker extends LitElement {
</ha-icon>
`
: this.fallbackPath
? html`<ha-svg-icon
.path=${this.fallbackPath}
slot="icon"
></ha-svg-icon>`
: ""}
? html`<ha-svg-icon
.path=${this.fallbackPath}
slot="icon"
></ha-svg-icon>`
: ""}
</ha-combo-box>
`;
}

View File

@ -96,8 +96,8 @@ class HaMountPicker extends LitElement {
.path=${mount.usage === SupervisorMountUsage.MEDIA
? mdiPlayBox
: mount.usage === SupervisorMountUsage.SHARE
? mdiFolder
: mdiBackupRestore}
? mdiFolder
: mdiBackupRestore}
></ha-svg-icon>
</ha-list-item>`
)}

View File

@ -145,13 +145,13 @@ export class HaMediaSelector extends LitElement {
.path=${!this.value?.media_content_id
? mdiPlus
: this.value?.metadata?.media_class
? MediaClassBrowserSettings[
this.value.metadata.media_class === "directory"
? this.value.metadata.children_media_class ||
this.value.metadata.media_class
: this.value.metadata.media_class
].icon
: mdiPlayBox}
? MediaClassBrowserSettings[
this.value.metadata.media_class === "directory"
? this.value.metadata.children_media_class ||
this.value.metadata.media_class
: this.value.metadata.media_class
].icon
: mdiPlayBox}
></ha-svg-icon>
</div>
`}

View File

@ -414,17 +414,17 @@ export class HaServiceControl extends LitElement {
></ha-selector
></ha-settings-row>`
: entityId
? html`<ha-entity-picker
.hass=${this.hass}
.disabled=${this.disabled}
.value=${this._value?.data?.entity_id}
.label=${this.hass.localize(
`component.${domain}.services.${serviceName}.fields.entity_id.description`
) || entityId.description}
@value-changed=${this._entityPicked}
allow-custom-entity
></ha-entity-picker>`
: ""}
? html`<ha-entity-picker
.hass=${this.hass}
.disabled=${this.disabled}
.value=${this._value?.data?.entity_id}
.label=${this.hass.localize(
`component.${domain}.services.${serviceName}.fields.entity_id.description`
) || entityId.description}
@value-changed=${this._entityPicked}
allow-custom-entity
></ha-entity-picker>`
: ""}
${shouldRenderServiceDataYaml
? html`<ha-yaml-editor
.hass=${this.hass}

View File

@ -425,8 +425,8 @@ class HaSidebar extends SubscribeMixin(LitElement) {
panel.url_path === this.hass.defaultPanel && !panel.icon
? PANEL_ICONS.lovelace
: panel.url_path in PANEL_ICONS
? PANEL_ICONS[panel.url_path]
: undefined
? PANEL_ICONS[panel.url_path]
: undefined
)
);
}
@ -499,11 +499,14 @@ class HaSidebar extends SubscribeMixin(LitElement) {
.path=${PANEL_ICONS.lovelace}
></ha-svg-icon>`
: panel.url_path in PANEL_ICONS
? html`<ha-svg-icon
slot="item-icon"
.path=${PANEL_ICONS[panel.url_path]}
></ha-svg-icon>`
: html`<ha-icon slot="item-icon" .icon=${panel.icon}></ha-icon>`}
? html`<ha-svg-icon
slot="item-icon"
.path=${PANEL_ICONS[panel.url_path]}
></ha-svg-icon>`
: html`<ha-icon
slot="item-icon"
.icon=${panel.icon}
></ha-icon>`}
<span class="item-text"
>${panel.url_path === this.hass.defaultPanel
? this.hass.localize("panel.states")

View File

@ -303,40 +303,40 @@ export class HaTargetPicker extends LitElement {
></ha-area-picker>
`
: this._addMode === "device_id"
? html`
<ha-device-picker
.hass=${this.hass}
id="input"
.type=${"device_id"}
.label=${this.hass.localize(
"ui.components.target-picker.add_device_id"
)}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDeviceClasses=${this.includeDeviceClasses}
.includeDomains=${this.includeDomains}
.excludeDevices=${ensureArray(this.value?.device_id)}
@value-changed=${this._targetPicked}
@click=${this._preventDefault}
></ha-device-picker>
`
: html`
<ha-entity-picker
.hass=${this.hass}
id="input"
.type=${"entity_id"}
.label=${this.hass.localize(
"ui.components.target-picker.add_entity_id"
)}
.entityFilter=${this.entityFilter}
.includeDeviceClasses=${this.includeDeviceClasses}
.includeDomains=${this.includeDomains}
.excludeEntities=${ensureArray(this.value?.entity_id)}
@value-changed=${this._targetPicked}
@click=${this._preventDefault}
allow-custom-entity
></ha-entity-picker>
`}</mwc-menu-surface
? html`
<ha-device-picker
.hass=${this.hass}
id="input"
.type=${"device_id"}
.label=${this.hass.localize(
"ui.components.target-picker.add_device_id"
)}
.deviceFilter=${this.deviceFilter}
.entityFilter=${this.entityFilter}
.includeDeviceClasses=${this.includeDeviceClasses}
.includeDomains=${this.includeDomains}
.excludeDevices=${ensureArray(this.value?.device_id)}
@value-changed=${this._targetPicked}
@click=${this._preventDefault}
></ha-device-picker>
`
: html`
<ha-entity-picker
.hass=${this.hass}
id="input"
.type=${"entity_id"}
.label=${this.hass.localize(
"ui.components.target-picker.add_entity_id"
)}
.entityFilter=${this.entityFilter}
.includeDeviceClasses=${this.includeDeviceClasses}
.includeDomains=${this.includeDomains}
.excludeEntities=${ensureArray(this.value?.entity_id)}
@value-changed=${this._targetPicked}
@click=${this._preventDefault}
allow-custom-entity
></ha-entity-picker>
`}</mwc-menu-surface
>`;
}

View File

@ -151,54 +151,54 @@ class DialogMediaManage extends LitElement {
</div>
`
: !children.length
? html`<div class="no-items">
<p>
${this.hass.localize(
"ui.components.media-browser.file_management.no_items"
)}
</p>
${this._currentItem?.children?.length
? html`<span class="folders"
>${this.hass.localize(
"ui.components.media-browser.file_management.folders_not_supported"
)}</span
>`
: ""}
</div>`
: html`
<mwc-list multi @selected=${this._handleSelected}>
${repeat(
children,
(item) => item.media_content_id,
(item) => {
const icon = html`
<ha-svg-icon
slot="graphic"
.path=${MediaClassBrowserSettings[
item.media_class === "directory"
? item.children_media_class || item.media_class
: item.media_class
].icon}
></ha-svg-icon>
`;
return html`
<ha-check-list-item
${animate({
id: item.media_content_id,
skipInitial: true,
})}
graphic="icon"
.disabled=${this._uploading || this._deleting}
.selected=${this._selected.has(fileIndex++)}
.item=${item}
>
${icon} ${item.title}
</ha-check-list-item>
`;
}
)}
</mwc-list>
`}
? html`<div class="no-items">
<p>
${this.hass.localize(
"ui.components.media-browser.file_management.no_items"
)}
</p>
${this._currentItem?.children?.length
? html`<span class="folders"
>${this.hass.localize(
"ui.components.media-browser.file_management.folders_not_supported"
)}</span
>`
: ""}
</div>`
: html`
<mwc-list multi @selected=${this._handleSelected}>
${repeat(
children,
(item) => item.media_content_id,
(item) => {
const icon = html`
<ha-svg-icon
slot="graphic"
.path=${MediaClassBrowserSettings[
item.media_class === "directory"
? item.children_media_class || item.media_class
: item.media_class
].icon}
></ha-svg-icon>
`;
return html`
<ha-check-list-item
${animate({
id: item.media_content_id,
skipInitial: true,
})}
graphic="icon"
.disabled=${this._uploading || this._deleting}
.selected=${this._selected.has(fileIndex++)}
.item=${item}
>
${icon} ${item.title}
</ha-check-list-item>
`;
}
)}
</mwc-list>
`}
${isComponentLoaded(this.hass, "hassio")
? html`<ha-tip .hass=${this.hass}>
${this.hass.localize(

View File

@ -445,107 +445,109 @@ export class HaMediaPlayerBrowse extends LitElement {
</div>
`
: isTTSMediaSource(currentItem.media_content_id)
? html`
<ha-browse-media-tts
.item=${currentItem}
.hass=${this.hass}
.action=${this.action}
@tts-picked=${this._ttsPicked}
></ha-browse-media-tts>
`
: !children.length && !currentItem.not_shown
? html`
<div class="container no-items">
${currentItem.media_content_id ===
"media-source://media_source/local/."
? html`
<div class="highlight-add-button">
<span>
<ha-svg-icon
.path=${mdiArrowUpRight}
></ha-svg-icon>
</span>
<span>
${this.hass.localize(
"ui.components.media-browser.file_management.highlight_button"
)}
</span>
</div>
`
: this.hass.localize(
"ui.components.media-browser.no_items"
)}
</div>
`
: childrenMediaClass.layout === "grid"
? html`
<lit-virtualizer
scroller
.layout=${grid({
itemSize: {
width: "175px",
height:
childrenMediaClass.thumbnail_ratio === "portrait"
? "312px"
: "225px",
},
gap: "16px",
flex: { preserve: "aspect-ratio" },
justify: "space-evenly",
direction: "vertical",
})}
.items=${children}
.renderItem=${this._renderGridItem}
class="children ${classMap({
portrait:
childrenMediaClass.thumbnail_ratio === "portrait",
not_shown: !!currentItem.not_shown,
})}"
></lit-virtualizer>
${currentItem.not_shown
? html`
<div class="grid not-shown">
<div class="title">
${this.hass.localize(
"ui.components.media-browser.not_shown",
{ count: currentItem.not_shown }
? html`
<ha-browse-media-tts
.item=${currentItem}
.hass=${this.hass}
.action=${this.action}
@tts-picked=${this._ttsPicked}
></ha-browse-media-tts>
`
: !children.length && !currentItem.not_shown
? html`
<div class="container no-items">
${currentItem.media_content_id ===
"media-source://media_source/local/."
? html`
<div class="highlight-add-button">
<span>
<ha-svg-icon
.path=${mdiArrowUpRight}
></ha-svg-icon>
</span>
<span>
${this.hass.localize(
"ui.components.media-browser.file_management.highlight_button"
)}
</span>
</div>
`
: this.hass.localize(
"ui.components.media-browser.no_items"
)}
</div>
</div>
</div>
`
: childrenMediaClass.layout === "grid"
? html`
<lit-virtualizer
scroller
.layout=${grid({
itemSize: {
width: "175px",
height:
childrenMediaClass.thumbnail_ratio ===
"portrait"
? "312px"
: "225px",
},
gap: "16px",
flex: { preserve: "aspect-ratio" },
justify: "space-evenly",
direction: "vertical",
})}
.items=${children}
.renderItem=${this._renderGridItem}
class="children ${classMap({
portrait:
childrenMediaClass.thumbnail_ratio ===
"portrait",
not_shown: !!currentItem.not_shown,
})}"
></lit-virtualizer>
${currentItem.not_shown
? html`
<div class="grid not-shown">
<div class="title">
${this.hass.localize(
"ui.components.media-browser.not_shown",
{ count: currentItem.not_shown }
)}
</div>
</div>
`
: ""}
`
: html`
<mwc-list>
<lit-virtualizer
scroller
.items=${children}
style=${styleMap({
height: `${children.length * 72 + 26}px`,
})}
.renderItem=${this._renderListItem}
></lit-virtualizer>
${currentItem.not_shown
? html`
<mwc-list-item
noninteractive
class="not-shown"
.graphic=${mediaClass.show_list_images
? "medium"
: "avatar"}
dir=${computeRTLDirection(this.hass)}
>
<span class="title">
${this.hass.localize(
"ui.components.media-browser.not_shown",
{ count: currentItem.not_shown }
)}
</span>
</mwc-list-item>
`
: ""}
</mwc-list>
`
: ""}
`
: html`
<mwc-list>
<lit-virtualizer
scroller
.items=${children}
style=${styleMap({
height: `${children.length * 72 + 26}px`,
})}
.renderItem=${this._renderListItem}
></lit-virtualizer>
${currentItem.not_shown
? html`
<mwc-list-item
noninteractive
class="not-shown"
.graphic=${mediaClass.show_list_images
? "medium"
: "avatar"}
dir=${computeRTLDirection(this.hass)}
>
<span class="title">
${this.hass.localize(
"ui.components.media-browser.not_shown",
{ count: currentItem.not_shown }
)}
</span>
</mwc-list-item>
`
: ""}
</mwc-list>
`
}
</div>
</div>

View File

@ -62,8 +62,8 @@ export class HaTracePathDetails extends LitElement {
${this._view === "config"
? this._renderSelectedConfig()
: this._view === "changed_variables"
? this._renderChangedVars()
: this._renderLogbook()}
? this._renderChangedVars()
: this._renderLogbook()}
`;
}
@ -134,8 +134,8 @@ export class HaTracePathDetails extends LitElement {
? html`Result:
<pre>${dump(result)}</pre>`
: error
? html`<div class="error">Error: ${error}</div>`
: ""}
? html`<div class="error">Error: ${error}</div>`
: ""}
${Object.keys(rest).length === 0
? ""
: html`<pre>${dump(rest)}</pre>`}

View File

@ -389,8 +389,8 @@ const tryDescribeTrigger = (
typeof at !== "string"
? at
: at.includes(".")
? `entity ${hass.states[at] ? computeStateName(hass.states[at]) : at}`
: localizeTimeString(at, hass.locale, hass.config)
? `entity ${hass.states[at] ? computeStateName(hass.states[at]) : at}`
: localizeTimeString(at, hass.locale, hass.config)
);
return hass.localize(`${triggerTranslationBaseKey}.time.description.full`, {
@ -411,10 +411,10 @@ const tryDescribeTrigger = (
const seconds = seconds_all
? 0
: typeof trigger.seconds === "number"
? trigger.seconds
: seconds_interval
? parseInt(trigger.seconds.substring(1))
: parseInt(trigger.seconds);
? trigger.seconds
: seconds_interval
? parseInt(trigger.seconds.substring(1))
: parseInt(trigger.seconds);
if (
isNaN(seconds) ||
@ -440,10 +440,10 @@ const tryDescribeTrigger = (
const minutes = minutes_all
? 0
: typeof trigger.minutes === "number"
? trigger.minutes
: minutes_interval
? parseInt(trigger.minutes.substring(1))
: parseInt(trigger.minutes);
? trigger.minutes
: minutes_interval
? parseInt(trigger.minutes.substring(1))
: parseInt(trigger.minutes);
if (
isNaN(minutes) ||
@ -477,10 +477,10 @@ const tryDescribeTrigger = (
const hours = hours_all
? 0
: typeof trigger.hours === "number"
? trigger.hours
: hours_interval
? parseInt(trigger.hours.substring(1))
: parseInt(trigger.hours);
? trigger.hours
: hours_interval
? parseInt(trigger.hours.substring(1))
: parseInt(trigger.hours);
if (
isNaN(hours) ||
@ -919,23 +919,23 @@ const tryDescribeCondition = (
typeof condition.before !== "string"
? condition.before
: condition.before.includes(".")
? `entity ${
hass.states[condition.before]
? computeStateName(hass.states[condition.before])
: condition.before
}`
: localizeTimeString(condition.before, hass.locale, hass.config);
? `entity ${
hass.states[condition.before]
? computeStateName(hass.states[condition.before])
: condition.before
}`
: localizeTimeString(condition.before, hass.locale, hass.config);
const after =
typeof condition.after !== "string"
? condition.after
: condition.after.includes(".")
? `entity ${
hass.states[condition.after]
? computeStateName(hass.states[condition.after])
: condition.after
}`
: localizeTimeString(condition.after, hass.locale, hass.config);
? `entity ${
hass.states[condition.after]
? computeStateName(hass.states[condition.after])
: condition.after
}`
: localizeTimeString(condition.after, hass.locale, hass.config);
let localizedDays: string[] = [];
if (validWeekdays) {

View File

@ -767,8 +767,8 @@ export const getEnergyGasUnit = (
return unitClass === "energy"
? "kWh"
: hass.config.unit_system.length === "km"
? "m³"
: "ft³";
? "m³"
: "ft³";
};
export const getEnergyWaterUnit = (hass: HomeAssistant): string | undefined =>

View File

@ -89,8 +89,8 @@ export function computeFanSpeedIcon(
return speed === "on"
? mdiFan
: speed === "off"
? mdiFanOff
: [mdiFanSpeed1, mdiFanSpeed2, mdiFanSpeed3][index - 1];
? mdiFanOff
: [mdiFanSpeed1, mdiFanSpeed2, mdiFanSpeed3][index - 1];
}
export const FAN_SPEED_COUNT_MAX_FOR_BUTTONS = 4;

View File

@ -377,8 +377,8 @@ const processLineChartEntities = (
entityId in hassEntities
? hassEntities[entityId].attributes
: "friendly_name" in first.a
? first.a
: undefined;
? first.a
: undefined;
data.push({
domain,

View File

@ -68,8 +68,8 @@ export const getLightCurrentModeRgbColor = (
entity.attributes.color_mode === LightColorMode.RGBWW
? entity.attributes.rgbww_color
: entity.attributes.color_mode === LightColorMode.RGBW
? entity.attributes.rgbw_color
: entity.attributes.rgb_color;
? entity.attributes.rgbw_color
: entity.attributes.rgb_color;
interface LightEntityAttributes extends HassEntityAttributeBase {
min_color_temp_kelvin?: number;

View File

@ -331,16 +331,16 @@ export const computeMediaControls = (
state === "on"
? mdiPlayPause
: state !== "playing"
? mdiPlay
: supportsFeature(stateObj, MediaPlayerEntityFeature.PAUSE)
? mdiPause
: mdiStop,
? mdiPlay
: supportsFeature(stateObj, MediaPlayerEntityFeature.PAUSE)
? mdiPause
: mdiStop,
action:
state !== "playing"
? "media_play"
: supportsFeature(stateObj, MediaPlayerEntityFeature.PAUSE)
? "media_pause"
: "media_stop",
? "media_pause"
: "media_stop",
});
}
@ -394,8 +394,8 @@ export const computeMediaControls = (
stateAttr.repeat === "all"
? mdiRepeat
: stateAttr.repeat === "one"
? mdiRepeatOnce
: mdiRepeatOff,
? mdiRepeatOnce
: mdiRepeatOff,
action: "repeat_set",
});
}
@ -459,18 +459,18 @@ export const handleMediaControlClick = (
shuffle: !stateObj!.attributes.shuffle,
}
: action === "repeat_set"
? {
entity_id: stateObj!.entity_id,
repeat:
stateObj!.attributes.repeat === "all"
? "one"
: stateObj!.attributes.repeat === "off"
? "all"
: "off",
}
: {
entity_id: stateObj!.entity_id,
}
? {
entity_id: stateObj!.entity_id,
repeat:
stateObj!.attributes.repeat === "all"
? "one"
: stateObj!.attributes.repeat === "off"
? "all"
: "off",
}
: {
entity_id: stateObj!.entity_id,
}
);
export const mediaPlayerPlayMedia = (

View File

@ -383,13 +383,13 @@ const getWeatherStateSVG = (
/>
`
: state === "partlycloudy"
? svg`
? svg`
<path
class="sun"
d="m14.981 4.2112c0 1.9244-1.56 3.4844-3.484 3.4844-1.9244 0-3.4844-1.56-3.4844-3.4844s1.56-3.484 3.4844-3.484c1.924 0 3.484 1.5596 3.484 3.484"
/>
`
: ""
: ""
}
${
cloudyStates.has(state)
@ -524,8 +524,8 @@ export const weatherIcon = (state?: string, nightTime?: boolean): string =>
!state
? undefined
: nightTime && state === "partlycloudy"
? mdiWeatherNightPartlyCloudy
: weatherIcons[state];
? mdiWeatherNightPartlyCloudy
: weatherIcons[state];
const EIGHT_HOURS = 28800000;
const DAY_IN_MILLISECONDS = 86400000;

View File

@ -227,107 +227,108 @@ class DataEntryFlowDialog extends LitElement {
></step-flow-loading>
`
: this._step === undefined
? // When we are going to next step, we render 1 round of empty
// to reset the element.
""
: html`
<div class="dialog-actions">
${([
"form",
"menu",
"external",
"progress",
"data_entry_flow_progressed",
].includes(this._step?.type as any) &&
this._params.manifest?.is_built_in) ||
this._params.manifest?.documentation
? html`
<a
href=${this._params.manifest.is_built_in
? documentationUrl(
this.hass,
`/integrations/${this._params.manifest.domain}`
)
: this._params?.manifest?.documentation}
target="_blank"
rel="noreferrer noopener"
>
<ha-icon-button
.label=${this.hass.localize("ui.common.help")}
.path=${mdiHelpCircle}
? // When we are going to next step, we render 1 round of empty
// to reset the element.
""
: html`
<div class="dialog-actions">
${([
"form",
"menu",
"external",
"progress",
"data_entry_flow_progressed",
].includes(this._step?.type as any) &&
this._params.manifest?.is_built_in) ||
this._params.manifest?.documentation
? html`
<a
href=${this._params.manifest.is_built_in
? documentationUrl(
this.hass,
`/integrations/${this._params.manifest.domain}`
)
: this._params?.manifest?.documentation}
target="_blank"
rel="noreferrer noopener"
>
</ha-icon-button
></a>
<ha-icon-button
.label=${this.hass.localize("ui.common.help")}
.path=${mdiHelpCircle}
>
</ha-icon-button
></a>
`
: ""}
<ha-icon-button
.label=${this.hass.localize(
"ui.panel.config.integrations.config_flow.dismiss"
)}
.path=${mdiClose}
dialogAction="close"
></ha-icon-button>
</div>
${this._step.type === "form"
? html`
<step-flow-form
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-form>
`
: ""}
<ha-icon-button
.label=${this.hass.localize(
"ui.panel.config.integrations.config_flow.dismiss"
)}
.path=${mdiClose}
dialogAction="close"
></ha-icon-button>
</div>
${this._step.type === "form"
? html`
<step-flow-form
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-form>
`
: this._step.type === "external"
? html`
<step-flow-external
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-external>
`
: this._step.type === "abort"
? html`
<step-flow-abort
.params=${this._params}
.step=${this._step}
.hass=${this.hass}
.domain=${this._step.handler}
></step-flow-abort>
`
: this._step.type === "progress"
? html`
<step-flow-progress
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-progress>
`
: this._step.type === "menu"
? html`
<step-flow-menu
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-menu>
`
: this._devices === undefined || this._areas === undefined
? // When it's a create entry result, we will fetch device & area registry
html`
<step-flow-loading
.flowConfig=${this._params.flowConfig}
.hass=${this.hass}
loadingReason="loading_devices_areas"
></step-flow-loading>
`
: html`
<step-flow-create-entry
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
.devices=${this._devices}
.areas=${this._areas}
></step-flow-create-entry>
`}
`}
: this._step.type === "external"
? html`
<step-flow-external
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-external>
`
: this._step.type === "abort"
? html`
<step-flow-abort
.params=${this._params}
.step=${this._step}
.hass=${this.hass}
.domain=${this._step.handler}
></step-flow-abort>
`
: this._step.type === "progress"
? html`
<step-flow-progress
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-progress>
`
: this._step.type === "menu"
? html`
<step-flow-menu
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
></step-flow-menu>
`
: this._devices === undefined ||
this._areas === undefined
? // When it's a create entry result, we will fetch device & area registry
html`
<step-flow-loading
.flowConfig=${this._params.flowConfig}
.hass=${this.hass}
loadingReason="loading_devices_areas"
></step-flow-loading>
`
: html`
<step-flow-create-entry
.flowConfig=${this._params.flowConfig}
.step=${this._step}
.hass=${this.hass}
.devices=${this._devices}
.areas=${this._areas}
></step-flow-create-entry>
`}
`}
</div>
</ha-dialog>
`;

View File

@ -66,56 +66,56 @@ class FlowPreviewTemplate extends LitElement {
${!this._listeners
? nothing
: this._listeners.all
? html`
<p class="all_listeners">
${this.hass.localize(
"ui.dialogs.helper_settings.template.all_listeners"
)}
</p>
`
: this._listeners.domains.length || this._listeners.entities.length
? html`
<p>
${this.hass.localize(
"ui.dialogs.helper_settings.template.listeners"
)}
</p>
<ul>
${this._listeners.domains
.sort()
.map(
(domain) => html`
<li>
<b
>${this.hass.localize(
"ui.dialogs.helper_settings.template.domain"
)}</b
>: ${domain}
</li>
`
? html`
<p class="all_listeners">
${this.hass.localize(
"ui.dialogs.helper_settings.template.all_listeners"
)}
${this._listeners.entities
.sort()
.map(
(entity_id) => html`
<li>
<b
>${this.hass.localize(
"ui.dialogs.helper_settings.template.entity"
)}</b
>: ${entity_id}
</li>
`
)}
</ul>
`
: !this._listeners.time
? html`<p class="all_listeners">
${this.hass.localize(
"ui.dialogs.helper_settings.template.no_listeners"
)}
</p>`
: nothing} `;
</p>
`
: this._listeners.domains.length || this._listeners.entities.length
? html`
<p>
${this.hass.localize(
"ui.dialogs.helper_settings.template.listeners"
)}
</p>
<ul>
${this._listeners.domains
.sort()
.map(
(domain) => html`
<li>
<b
>${this.hass.localize(
"ui.dialogs.helper_settings.template.domain"
)}</b
>: ${domain}
</li>
`
)}
${this._listeners.entities
.sort()
.map(
(entity_id) => html`
<li>
<b
>${this.hass.localize(
"ui.dialogs.helper_settings.template.entity"
)}</b
>: ${entity_id}
</li>
`
)}
</ul>
`
: !this._listeners.time
? html`<p class="all_listeners">
${this.hass.localize(
"ui.dialogs.helper_settings.template.no_listeners"
)}
</p>`
: nothing} `;
}
private _setPreview = (preview: TemplatePreview) => {

View File

@ -137,36 +137,36 @@ export class DialogEnterCode
value === ""
? html`<span></span>`
: value === "clear"
? html`
<ha-control-button
@click=${this._clear}
class="clear"
.disabled=${!this._showClearButton}
.label=${this.hass!.localize("ui.common.clear")}
>
<ha-svg-icon path=${mdiClose}></ha-svg-icon>
</ha-control-button>
`
: value === "submit"
? html`
<ha-control-button
@click=${this._submit}
class="submit"
.label=${this._dialogParams!.submitText ??
this.hass!.localize("ui.common.submit")}
>
<ha-svg-icon path=${mdiCheck}></ha-svg-icon>
</ha-control-button>
`
: html`
<ha-control-button
.value=${value}
@click=${this._numberClick}
.label=${value}
>
${value}
</ha-control-button>
`
? html`
<ha-control-button
@click=${this._clear}
class="clear"
.disabled=${!this._showClearButton}
.label=${this.hass!.localize("ui.common.clear")}
>
<ha-svg-icon path=${mdiClose}></ha-svg-icon>
</ha-control-button>
`
: value === "submit"
? html`
<ha-control-button
@click=${this._submit}
class="submit"
.label=${this._dialogParams!.submitText ??
this.hass!.localize("ui.common.submit")}
>
<ha-svg-icon path=${mdiCheck}></ha-svg-icon>
</ha-control-button>
`
: html`
<ha-control-button
.value=${value}
@click=${this._numberClick}
.label=${value}
>
${value}
</ha-control-button>
`
)}
</div>
</div>

View File

@ -189,8 +189,8 @@ export class HaMoreInfoClimateTemperature extends LitElement {
{ action: actionLabel }
)
: action && action !== "off" && action !== "idle"
? actionLabel
: this.hass.localize("ui.dialogs.more_info_control.climate.target")}
? actionLabel
: this.hass.localize("ui.dialogs.more_info_control.climate.target")}
</p>
`;
}

View File

@ -104,10 +104,10 @@ export class HaMoreInfoHumidifierHumidity extends LitElement {
{ action: actionLabel }
)
: action && action !== "off" && action !== "idle"
? actionLabel
: this.hass.localize(
"ui.dialogs.more_info_control.humidifier.target"
)}
? actionLabel
: this.hass.localize(
"ui.dialogs.more_info_control.humidifier.target"
)}
</p>
`;
}

View File

@ -139,13 +139,13 @@ class MoreInfoCover extends LitElement {
></ha-more-info-cover-toggle>
`
: supportsOpenClose || supportsTilt
? html`
<ha-more-info-cover-buttons
.stateObj=${this.stateObj}
.hass=${this.hass}
></ha-more-info-cover-buttons>
`
: nothing}
? html`
<ha-more-info-cover-buttons
.stateObj=${this.stateObj}
.hass=${this.hass}
></ha-more-info-cover-buttons>
`
: nothing}
`
: nothing
}

View File

@ -39,8 +39,8 @@ class MoreInfoInputDatetime extends LitElement {
.value=${this.stateObj.state === UNKNOWN
? ""
: this.stateObj.attributes.has_date
? this.stateObj.state.split(" ")[1]
: this.stateObj.state}
? this.stateObj.state.split(" ")[1]
: this.stateObj.state}
.locale=${this.hass.locale}
.disabled=${isUnavailableState(this.stateObj.state)}
@value-changed=${this._timeChanged}

View File

@ -108,11 +108,11 @@ class MoreInfoUpdate extends LitElement {
<ha-markdown .content=${this._releaseNotes}></ha-markdown>
</ha-faded> `
: this.stateObj.attributes.release_summary
? html`<hr />
<ha-markdown
.content=${this.stateObj.attributes.release_summary}
></ha-markdown>`
: ""}
? html`<hr />
<ha-markdown
.content=${this.stateObj.attributes.release_summary}
></ha-markdown>`
: ""}
${supportsFeature(this.stateObj, UPDATE_SUPPORT_BACKUP)
? html`<hr />
<ha-formfield
@ -131,26 +131,26 @@ class MoreInfoUpdate extends LitElement {
${this.stateObj.attributes.auto_update
? ""
: this.stateObj.state === BINARY_STATE_OFF &&
this.stateObj.attributes.skipped_version
? html`
<mwc-button @click=${this._handleClearSkipped}>
${this.hass.localize(
"ui.dialogs.more_info_control.update.clear_skipped"
)}
</mwc-button>
`
: html`
<mwc-button
@click=${this._handleSkip}
.disabled=${skippedVersion ||
this.stateObj.state === BINARY_STATE_OFF ||
updateIsInstalling(this.stateObj)}
>
${this.hass.localize(
"ui.dialogs.more_info_control.update.skip"
)}
</mwc-button>
`}
this.stateObj.attributes.skipped_version
? html`
<mwc-button @click=${this._handleClearSkipped}>
${this.hass.localize(
"ui.dialogs.more_info_control.update.clear_skipped"
)}
</mwc-button>
`
: html`
<mwc-button
@click=${this._handleSkip}
.disabled=${skippedVersion ||
this.stateObj.state === BINARY_STATE_OFF ||
updateIsInstalling(this.stateObj)}
>
${this.hass.localize(
"ui.dialogs.more_info_control.update.skip"
)}
</mwc-button>
`}
${supportsFeature(this.stateObj, UPDATE_SUPPORT_INSTALL)
? html`
<mwc-button

View File

@ -269,20 +269,20 @@ class MoreInfoWeather extends LitElement {
: this.hass!.localize("ui.card.weather.night")})
`
: hourly
? html`
${formatTimeWeekday(
new Date(item.datetime),
this.hass!.locale,
this.hass!.config
)}
`
: html`
${formatDateWeekdayDay(
new Date(item.datetime),
this.hass!.locale,
this.hass!.config
)}
`}
? html`
${formatTimeWeekday(
new Date(item.datetime),
this.hass!.locale,
this.hass!.config
)}
`
: html`
${formatDateWeekdayDay(
new Date(item.datetime),
this.hass!.locale,
this.hass!.config
)}
`}
</div>
<div class="templow">
${this._showValue(item.templow)
@ -292,8 +292,8 @@ class MoreInfoWeather extends LitElement {
item.templow
)
: hourly
? ""
: "—"}
? ""
: "—"}
</div>
<div class="temp">
${this._showValue(item.temperature)

View File

@ -429,41 +429,41 @@ export class MoreInfoDialog extends LitElement {
</div>
`
: this._currView === "info"
? html`
<ha-more-info-info
dialogInitialFocus
.hass=${this.hass}
.entityId=${this._entityId}
.entry=${this._entry}
.editMode=${this._infoEditMode}
></ha-more-info-info>
`
: this._currView === "history"
? html`
<ha-more-info-history-and-logbook
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-history-and-logbook>
`
: this._currView === "settings"
? html`
<ha-more-info-settings
.hass=${this.hass}
.entityId=${this._entityId}
.entry=${this._entry}
></ha-more-info-settings>
`
: this._currView === "related"
? html`
<ha-related-items
.hass=${this.hass}
.itemId=${entityId}
.itemType=${SearchableDomains.has(domain)
? domain
: "entity"}
></ha-related-items>
`
: nothing
? html`
<ha-more-info-info
dialogInitialFocus
.hass=${this.hass}
.entityId=${this._entityId}
.entry=${this._entry}
.editMode=${this._infoEditMode}
></ha-more-info-info>
`
: this._currView === "history"
? html`
<ha-more-info-history-and-logbook
.hass=${this.hass}
.entityId=${this._entityId}
></ha-more-info-history-and-logbook>
`
: this._currView === "settings"
? html`
<ha-more-info-settings
.hass=${this.hass}
.entityId=${this._entityId}
.entry=${this._entry}
></ha-more-info-settings>
`
: this._currView === "related"
? html`
<ha-related-items
.hass=${this.hass}
.itemId=${entityId}
.itemType=${SearchableDomains.has(domain)
? domain
: "entity"}
></ha-related-items>
`
: nothing
)}
</div>
</ha-dialog>

View File

@ -84,24 +84,24 @@ export class MoreInfoHistory extends LitElement {
${this._error
? html`<div class="errors">${this._error}</div>`
: this._statistics
? html`<statistics-chart
.hass=${this.hass}
.isLoadingData=${!this._statistics}
.statisticsData=${this._statistics}
.metadata=${this._metadata}
.statTypes=${statTypes}
.names=${this._statNames}
hideLegend
.showNames=${false}
></statistics-chart>`
: html`<state-history-charts
up-to-now
.hass=${this.hass}
.historyData=${this._stateHistory}
.isLoadingData=${!this._stateHistory}
.showNames=${false}
.clickForMoreInfo=${false}
></state-history-charts>`}`
? html`<statistics-chart
.hass=${this.hass}
.isLoadingData=${!this._statistics}
.statisticsData=${this._statistics}
.metadata=${this._metadata}
.statTypes=${statTypes}
.names=${this._statNames}
hideLegend
.showNames=${false}
></statistics-chart>`
: html`<state-history-charts
up-to-now
.hass=${this.hass}
.historyData=${this._stateHistory}
.isLoadingData=${!this._stateHistory}
.showNames=${false}
.clickForMoreInfo=${false}
></state-history-charts>`}`
: ""}`;
}

View File

@ -217,35 +217,36 @@ export class QuickBar extends LitElement {
active
></ha-circular-progress>`
: items.length === 0
? html`
<div class="nothing-found">
${this.hass.localize("ui.dialogs.quick-bar.nothing_found")}
</div>
`
: html`
<mwc-list>
${this._opened
? html`<lit-virtualizer
scroller
@keydown=${this._handleListItemKeyDown}
@rangechange=${this._handleRangeChanged}
@click=${this._handleItemClick}
class="ha-scrollbar"
style=${styleMap({
height: this._narrow
? "calc(100vh - 56px)"
: `${Math.min(
items.length * (this._commandMode ? 56 : 72) + 26,
500
)}px`,
})}
.items=${items}
.renderItem=${this._renderItem}
>
</lit-virtualizer>`
: ""}
</mwc-list>
`}
? html`
<div class="nothing-found">
${this.hass.localize("ui.dialogs.quick-bar.nothing_found")}
</div>
`
: html`
<mwc-list>
${this._opened
? html`<lit-virtualizer
scroller
@keydown=${this._handleListItemKeyDown}
@rangechange=${this._handleRangeChanged}
@click=${this._handleItemClick}
class="ha-scrollbar"
style=${styleMap({
height: this._narrow
? "calc(100vh - 56px)"
: `${Math.min(
items.length * (this._commandMode ? 56 : 72) +
26,
500
)}px`,
})}
.items=${items}
.renderItem=${this._renderItem}
>
</lit-virtualizer>`
: ""}
</mwc-list>
`}
${this._hint
? html`<ha-tip .hass=${this.hass}>${this._hint}</ha-tip>`
: ""}

View File

@ -349,8 +349,8 @@ class ClimateEntity extends Entity {
lowTarget >= current
? "heating"
: highTarget <= current
? "cooling"
: "idle";
? "cooling"
: "idle";
}
return state;
}

View File

@ -57,19 +57,19 @@ class HassSubpage extends LitElement {
></ha-menu-button>
`
: this.backPath
? html`
<a href=${this.backPath}>
? html`
<a href=${this.backPath}>
<ha-icon-button-arrow-prev
.hass=${this.hass}
></ha-icon-button-arrow-prev>
</a>
`
: html`
<ha-icon-button-arrow-prev
.hass=${this.hass}
@click=${this._backTapped}
></ha-icon-button-arrow-prev>
</a>
`
: html`
<ha-icon-button-arrow-prev
.hass=${this.hass}
@click=${this._backTapped}
></ha-icon-button-arrow-prev>
`}
`}
<div class="main-title"><slot name="header">${this.header}</slot></div>
<slot name="toolbar-icon"></slot>

View File

@ -156,19 +156,19 @@ class HassTabsSubpage extends LitElement {
></ha-menu-button>
`
: this.backPath
? html`
<a href=${this.backPath}>
? html`
<a href=${this.backPath}>
<ha-icon-button-arrow-prev
.hass=${this.hass}
></ha-icon-button-arrow-prev>
</a>
`
: html`
<ha-icon-button-arrow-prev
.hass=${this.hass}
@click=${this._backTapped}
></ha-icon-button-arrow-prev>
</a>
`
: html`
<ha-icon-button-arrow-prev
.hass=${this.hass}
@click=${this._backTapped}
></ha-icon-button-arrow-prev>
`}
`}
${this.narrow || !showTabs
? html`<div class="main-title">
<slot name="header">${!showTabs ? tabs[0] : ""}</slot>

View File

@ -127,10 +127,10 @@ export class HomeAssistantMain extends LitElement {
dock: ev.detail?.open
? "docked"
: ev.detail?.open === false
? "auto"
: this.hass.dockedSidebar === "auto"
? "docked"
: "auto",
? "auto"
: this.hass.dockedSidebar === "auto"
? "docked"
: "auto",
});
}
});

View File

@ -342,50 +342,56 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
></manual-automation-editor>
`
: this._mode === "yaml"
? html`
${this._readOnly
? html`<ha-alert alert-type="warning">
${this.hass.localize(
"ui.panel.config.automation.editor.read_only"
)}
<mwc-button slot="action" @click=${this._duplicate}>
? html`
${this._readOnly
? html`<ha-alert alert-type="warning">
${this.hass.localize(
"ui.panel.config.automation.editor.migrate"
"ui.panel.config.automation.editor.read_only"
)}
</mwc-button>
</ha-alert>`
: ""}
${stateObj?.state === "off"
? html`
<ha-alert alert-type="info">
${this.hass.localize(
"ui.panel.config.automation.editor.disabled"
)}
<mwc-button slot="action" @click=${this._toggle}>
<mwc-button
slot="action"
@click=${this._duplicate}
>
${this.hass.localize(
"ui.panel.config.automation.editor.enable"
"ui.panel.config.automation.editor.migrate"
)}
</mwc-button>
</ha-alert>
`
: ""}
<ha-yaml-editor
.hass=${this.hass}
.defaultValue=${this._preprocessYaml()}
.readOnly=${this._readOnly}
@value-changed=${this._yamlChanged}
></ha-yaml-editor>
<ha-card outlined>
<div class="card-actions">
<mwc-button @click=${this._copyYaml}>
${this.hass.localize(
"ui.panel.config.automation.editor.copy_to_clipboard"
)}
</mwc-button>
</div>
</ha-card>
`
: ``}
</ha-alert>`
: ""}
${stateObj?.state === "off"
? html`
<ha-alert alert-type="info">
${this.hass.localize(
"ui.panel.config.automation.editor.disabled"
)}
<mwc-button
slot="action"
@click=${this._toggle}
>
${this.hass.localize(
"ui.panel.config.automation.editor.enable"
)}
</mwc-button>
</ha-alert>
`
: ""}
<ha-yaml-editor
.hass=${this.hass}
.defaultValue=${this._preprocessYaml()}
.readOnly=${this._readOnly}
@value-changed=${this._yamlChanged}
></ha-yaml-editor>
<ha-card outlined>
<div class="card-actions">
<mwc-button @click=${this._copyYaml}>
${this.hass.localize(
"ui.panel.config.automation.editor.copy_to_clipboard"
)}
</mwc-button>
</div>
</ha-card>
`
: ``}
</div>
`
: ""}

View File

@ -215,104 +215,104 @@ export class HaAutomationTrace extends LitElement {
${this._traces === undefined
? html`<div class="container">Loading…</div>`
: this._traces.length === 0
? html`<div class="container">No traces found</div>`
: this._trace === undefined
? ""
: html`
<div class="main">
<div class="graph">
<hat-script-graph
.trace=${this._trace}
.selected=${this._selected?.path}
@graph-node-selected=${this._pickNode}
></hat-script-graph>
</div>
? html`<div class="container">No traces found</div>`
: this._trace === undefined
? ""
: html`
<div class="main">
<div class="graph">
<hat-script-graph
.trace=${this._trace}
.selected=${this._selected?.path}
@graph-node-selected=${this._pickNode}
></hat-script-graph>
</div>
<div class="info">
<div class="tabs top">
${[
["details", "Step Details"],
["timeline", "Trace Timeline"],
["logbook", "Related logbook entries"],
["config", "Automation Config"],
].map(
([view, label]) => html`
<button
tabindex="0"
.view=${view}
class=${classMap({ active: this._view === view })}
@click=${this._showTab}
>
${label}
</button>
`
)}
${this._trace.blueprint_inputs
? html`
<button
tabindex="0"
.view=${"blueprint"}
class=${classMap({
active: this._view === "blueprint",
})}
@click=${this._showTab}
>
Blueprint Config
</button>
`
: ""}
<div class="info">
<div class="tabs top">
${[
["details", "Step Details"],
["timeline", "Trace Timeline"],
["logbook", "Related logbook entries"],
["config", "Automation Config"],
].map(
([view, label]) => html`
<button
tabindex="0"
.view=${view}
class=${classMap({ active: this._view === view })}
@click=${this._showTab}
>
${label}
</button>
`
)}
${this._trace.blueprint_inputs
? html`
<button
tabindex="0"
.view=${"blueprint"}
class=${classMap({
active: this._view === "blueprint",
})}
@click=${this._showTab}
>
Blueprint Config
</button>
`
: ""}
</div>
${this._selected === undefined ||
this._logbookEntries === undefined ||
trackedNodes === undefined
? ""
: this._view === "details"
? html`
<ha-trace-path-details
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.selected=${this._selected}
.logbookEntries=${this._logbookEntries}
.trackedNodes=${trackedNodes}
.renderedNodes=${renderedNodes!}
></ha-trace-path-details>
`
: this._view === "config"
? html`
<ha-trace-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-config>
`
: this._view === "logbook"
? html`
<ha-trace-logbook
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
></ha-trace-logbook>
`
: this._view === "blueprint"
? html`
<ha-trace-blueprint-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-blueprint-config>
`
: html`
<ha-trace-timeline
.hass=${this.hass}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
.selected=${this._selected}
@value-changed=${this._timelinePathPicked}
></ha-trace-timeline>
`}
</div>
</div>
${this._selected === undefined ||
this._logbookEntries === undefined ||
trackedNodes === undefined
? ""
: this._view === "details"
? html`
<ha-trace-path-details
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.selected=${this._selected}
.logbookEntries=${this._logbookEntries}
.trackedNodes=${trackedNodes}
.renderedNodes=${renderedNodes!}
></ha-trace-path-details>
`
: this._view === "config"
? html`
<ha-trace-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-config>
`
: this._view === "logbook"
? html`
<ha-trace-logbook
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
></ha-trace-logbook>
`
: this._view === "blueprint"
? html`
<ha-trace-blueprint-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-blueprint-config>
`
: html`
<ha-trace-timeline
.hass=${this.hass}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
.selected=${this._selected}
@value-changed=${this._timelinePathPicked}
></ha-trace-timeline>
`}
</div>
</div>
`}
`}
</hass-subpage>
`;
}

View File

@ -114,12 +114,12 @@ export class CloudAccount extends SubscribeMixin(LitElement) {
"ui.panel.config.cloud.account.connected"
)
: this.cloudStatus.cloud === "disconnected"
? this.hass.localize(
"ui.panel.config.cloud.account.not_connected"
)
: this.hass.localize(
"ui.panel.config.cloud.account.connecting"
)}
? this.hass.localize(
"ui.panel.config.cloud.account.not_connected"
)
: this.hass.localize(
"ui.panel.config.cloud.account.connecting"
)}
</div>
</div>

View File

@ -52,16 +52,16 @@ export class CloudRemotePref extends LitElement {
"ui.panel.config.cloud.account.remote.cerificate_error"
)
: remote_certificate_status === "loading"
? this.hass.localize(
"ui.panel.config.cloud.account.remote.cerificate_loading"
)
: remote_certificate_status === "loaded"
? this.hass.localize(
"ui.panel.config.cloud.account.remote.cerificate_loaded"
)
: this.hass.localize(
"ui.panel.config.cloud.account.remote.access_is_being_prepared"
)}
? this.hass.localize(
"ui.panel.config.cloud.account.remote.cerificate_loading"
)
: remote_certificate_status === "loaded"
? this.hass.localize(
"ui.panel.config.cloud.account.remote.cerificate_loaded"
)
: this.hass.localize(
"ui.panel.config.cloud.account.remote.access_is_being_prepared"
)}
</div>
</ha-card>
`;

View File

@ -59,55 +59,57 @@ export class CloudWebhooks extends LitElement {
</div>
`
: this._localHooks.length === 0
? html`
<div class="body-text">
${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet"
)}
<a href="/config/integrations"
>${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet_link_integration"
? html`
<div class="body-text">
${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet"
)}
</a>
${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet2"
)}
<a href="/config/automation/edit/new"
>${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet_link_automation"
)}</a
>.
</div>
`
: this._localHooks.map(
(entry) => html`
<ha-settings-row .narrow=${this.narrow} .entry=${entry}>
<span slot="heading">
${entry.name}
${entry.domain !== entry.name.toLowerCase()
? ` (${entry.domain})`
: ""}
</span>
<span slot="description">${entry.webhook_id}</span>
${this._progress.includes(entry.webhook_id)
? html`
<div class="progress">
<ha-circular-progress active></ha-circular-progress>
</div>
`
: this._cloudHooks![entry.webhook_id]
? html`
<mwc-button @click=${this._handleManageButton}>
${this.hass!.localize(
"ui.panel.config.cloud.account.webhooks.manage"
)}
</mwc-button>
`
: html`<ha-switch @click=${this._enableWebhook}>
</ha-switch>`}
</ha-settings-row>
<a href="/config/integrations"
>${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet_link_integration"
)}
</a>
${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet2"
)}
<a href="/config/automation/edit/new"
>${this.hass.localize(
"ui.panel.config.cloud.account.webhooks.no_hooks_yet_link_automation"
)}</a
>.
</div>
`
)}
: this._localHooks.map(
(entry) => html`
<ha-settings-row .narrow=${this.narrow} .entry=${entry}>
<span slot="heading">
${entry.name}
${entry.domain !== entry.name.toLowerCase()
? ` (${entry.domain})`
: ""}
</span>
<span slot="description">${entry.webhook_id}</span>
${this._progress.includes(entry.webhook_id)
? html`
<div class="progress">
<ha-circular-progress
active
></ha-circular-progress>
</div>
`
: this._cloudHooks![entry.webhook_id]
? html`
<mwc-button @click=${this._handleManageButton}>
${this.hass!.localize(
"ui.panel.config.cloud.account.webhooks.manage"
)}
</mwc-button>
`
: html`<ha-switch @click=${this._enableWebhook}>
</ha-switch>`}
</ha-settings-row>
`
)}
<div class="footer">
<a
href="https://www.nabucasa.com/config/webhooks"

View File

@ -34,8 +34,8 @@ class ConfigAnalytics extends LitElement {
const error = this._error
? this._error
: !isComponentLoaded(this.hass, "analytics")
? "Analytics integration not loaded"
: undefined;
? "Analytics integration not loaded"
: undefined;
return html`
<ha-card outlined>

View File

@ -164,10 +164,10 @@ class HaConfigSystemNavigation extends LitElement {
const backups: BackupContent[] | HassioBackup[] = isHassioLoaded
? await fetchHassioBackups(this.hass)
: isComponentLoaded(this.hass, "backup")
? await fetchBackupInfo(this.hass).then(
(backupData) => backupData.backups
)
: [];
? await fetchBackupInfo(this.hass).then(
(backupData) => backupData.backups
)
: [];
if (backups.length > 0) {
this._latestBackupDate = (backups as any[]).reduce((a, b) =>

View File

@ -167,11 +167,11 @@ export class HaDeviceEntitiesCard extends LitElement {
let name = entry.name
? stripPrefixFromEntityName(entry.name, this.deviceName.toLowerCase())
: entry.has_entity_name
? entry.original_name || this.deviceName
: stripPrefixFromEntityName(
computeStateName(stateObj),
this.deviceName.toLowerCase()
);
? entry.original_name || this.deviceName
: stripPrefixFromEntityName(
computeStateName(stateObj),
this.deviceName.toLowerCase()
);
if (!name) {
name = computeStateName(stateObj);

View File

@ -113,12 +113,12 @@ export class HaDeviceInfoZWaveJS extends SubscribeMixin(LitElement) {
}.title`
)
: this._node.is_secure === false
? this.hass.localize(
"ui.panel.config.zwave_js.security_classes.none.title"
)
: this.hass.localize(
"ui.panel.config.zwave_js.device_info.unknown"
)}
? this.hass.localize(
"ui.panel.config.zwave_js.security_classes.none.title"
)
: this.hass.localize(
"ui.panel.config.zwave_js.device_info.unknown"
)}
</div>
<div>
${this.hass.localize(

View File

@ -207,10 +207,10 @@ export class HaConfigDevicePage extends LitElement {
entry.entity_category
? entry.entity_category
: computeDomain(entry.entity_id) === "event"
? "event"
: SENSOR_ENTITIES.includes(computeDomain(entry.entity_id))
? "sensor"
: "control"
? "event"
: SENSOR_ENTITIES.includes(computeDomain(entry.entity_id))
? "sensor"
: "control"
) as Record<
| "control"
| "event"

View File

@ -67,10 +67,10 @@ export class DialogEnergyGasSettings
this._costs = this._source.entity_energy_price
? "entity"
: this._source.number_energy_price
? "number"
: this._source.stat_cost
? "statistic"
: "no-costs";
? "number"
: this._source.stat_cost
? "statistic"
: "no-costs";
this._energy_units = (
await getSensorDeviceClassConvertibleUnits(this.hass, "energy")
).units;
@ -100,8 +100,8 @@ export class DialogEnergyGasSettings
this._params.allowedGasUnitClass === undefined
? [...(this._gas_units || []), ...(this._energy_units || [])].join(", ")
: this._params.allowedGasUnitClass === "energy"
? this._energy_units?.join(", ") || ""
: this._gas_units?.join(", ") || "";
? this._energy_units?.join(", ") || ""
: this._gas_units?.join(", ") || "";
const unitPrice = this._pickedDisplayUnit
? `${this.hass.config.currency}/${this._pickedDisplayUnit}`

View File

@ -59,17 +59,17 @@ export class DialogEnergyGridFlowSettings
this._source = params.source
? { ...params.source }
: params.direction === "from"
? emptyFlowFromGridSourceEnergyPreference()
: emptyFlowToGridSourceEnergyPreference();
? emptyFlowFromGridSourceEnergyPreference()
: emptyFlowToGridSourceEnergyPreference();
this._costs = this._source.entity_energy_price
? "entity"
: this._source.number_energy_price
? "number"
: this._source[
params.direction === "from" ? "stat_cost" : "stat_compensation"
]
? "statistic"
: "no-costs";
? "number"
: this._source[
params.direction === "from" ? "stat_cost" : "stat_compensation"
]
? "statistic"
: "no-costs";
const initialSourceId =
this._source[

View File

@ -204,13 +204,13 @@ export class DialogEnergySolarSettings
domains.length === 0
? []
: domains.length === 1
? await getConfigEntries(this.hass, {
type: ["service"],
domain: domains[0],
})
: (await getConfigEntries(this.hass, { type: ["service"] })).filter(
(entry) => domains.includes(entry.domain)
);
? await getConfigEntries(this.hass, {
type: ["service"],
domain: domains[0],
})
: (await getConfigEntries(this.hass, { type: ["service"] })).filter(
(entry) => domains.includes(entry.domain)
);
}
private _handleForecastChanged(ev: CustomEvent) {

View File

@ -62,10 +62,10 @@ export class DialogEnergyWaterSettings
this._costs = this._source.entity_energy_price
? "entity"
: this._source.number_energy_price
? "number"
: this._source.stat_cost
? "statistic"
: "no-costs";
? "number"
: this._source.stat_cost
? "statistic"
: "no-costs";
this._water_units = (
await getSensorDeviceClassConvertibleUnits(this.hass, "water")
).units;

View File

@ -86,16 +86,16 @@ export class EntityRegistrySettingsHelper extends LitElement {
this.entry.platform
)
: this._item === null
? this.hass.localize("ui.dialogs.helper_settings.yaml_not_editable")
: html`
<span @value-changed=${this._valueChanged}>
${dynamicElement(`ha-${this.entry.platform}-form`, {
hass: this.hass,
item: this._item,
entry: this.entry,
})}
</span>
`}
? this.hass.localize("ui.dialogs.helper_settings.yaml_not_editable")
: html`
<span @value-changed=${this._valueChanged}>
${dynamicElement(`ha-${this.entry.platform}-form`, {
hass: this.hass,
item: this._item,
entry: this.entry,
})}
</span>
`}
<entity-registry-settings-editor
.hass=${this.hass}
.entry=${this.entry}

View File

@ -428,37 +428,37 @@ export class EntityRegistrySettingsEditor extends LitElement {
)}
</ha-select>`
: this.helperConfigEntry?.domain === "switch_as_x"
? html`<ha-select
.label=${this.hass.localize(
"ui.dialogs.entity_registry.editor.switch_as_x"
)}
.value=${this._switchAs}
naturalMenuWidth
fixedMenuPosition
@selected=${this._switchAsChanged}
@closed=${stopPropagation}
>
<ha-list-item value="switch">
${domainToName(this.hass.localize, "switch")}
</ha-list-item>
<ha-list-item .value=${domain}>
${domainToName(this.hass.localize, domain)}
</ha-list-item>
<li divider role="separator"></li>
${this._switchAsDomainsSorted(
SWITCH_AS_DOMAINS,
this.hass.localize
).map((entry) =>
domain === entry.domain
? nothing
: html`
<ha-list-item .value=${entry.domain}>
${entry.label}
</ha-list-item>
`
)}
</ha-select>`
: nothing}
? html`<ha-select
.label=${this.hass.localize(
"ui.dialogs.entity_registry.editor.switch_as_x"
)}
.value=${this._switchAs}
naturalMenuWidth
fixedMenuPosition
@selected=${this._switchAsChanged}
@closed=${stopPropagation}
>
<ha-list-item value="switch">
${domainToName(this.hass.localize, "switch")}
</ha-list-item>
<ha-list-item .value=${domain}>
${domainToName(this.hass.localize, domain)}
</ha-list-item>
<li divider role="separator"></li>
${this._switchAsDomainsSorted(
SWITCH_AS_DOMAINS,
this.hass.localize
).map((entry) =>
domain === entry.domain
? nothing
: html`
<ha-list-item .value=${entry.domain}>
${entry.label}
</ha-list-item>
`
)}
</ha-select>`
: nothing}
${this._deviceClassOptions
? html`
<ha-select

View File

@ -97,21 +97,23 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
)}
</mwc-button>`
: this.entry.disabled_by
? html`${this.hass!.localize(
"ui.dialogs.entity_registry.editor.entity_disabled"
)}${["user", "integration"].includes(this.entry.disabled_by!)
? html`<mwc-button
slot="action"
@click=${this._enableEntry}
>
${this.hass!.localize(
"ui.dialogs.entity_registry.editor.enable_entity"
)}</mwc-button
>`
: ""}`
: this.hass!.localize(
"ui.dialogs.entity_registry.editor.unavailable"
)}
? html`${this.hass!.localize(
"ui.dialogs.entity_registry.editor.entity_disabled"
)}${["user", "integration"].includes(
this.entry.disabled_by!
)
? html`<mwc-button
slot="action"
@click=${this._enableEntry}
>
${this.hass!.localize(
"ui.dialogs.entity_registry.editor.enable_entity"
)}</mwc-button
>`
: ""}`
: this.hass!.localize(
"ui.dialogs.entity_registry.editor.unavailable"
)}
</ha-alert>
`
: ""}

View File

@ -268,12 +268,12 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
.path=${entry.restored
? mdiRestoreAlert
: entry.unavailable
? mdiAlertCircle
: entry.disabled_by
? mdiCancel
: entry.hidden_by
? mdiEyeOff
: mdiPencilOff}
? mdiAlertCircle
: entry.disabled_by
? mdiCancel
: entry.hidden_by
? mdiEyeOff
: mdiPencilOff}
></ha-svg-icon>
<simple-tooltip animation-delay="0" position="left">
${entry.restored
@ -281,20 +281,20 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
"ui.panel.config.entities.picker.status.restored"
)
: entry.unavailable
? this.hass.localize(
"ui.panel.config.entities.picker.status.unavailable"
)
: entry.disabled_by
? this.hass.localize(
"ui.panel.config.entities.picker.status.disabled"
)
: entry.hidden_by
? this.hass.localize(
"ui.panel.config.entities.picker.status.hidden"
)
: this.hass.localize(
"ui.panel.config.entities.picker.status.readonly"
)}
? this.hass.localize(
"ui.panel.config.entities.picker.status.unavailable"
)
: entry.disabled_by
? this.hass.localize(
"ui.panel.config.entities.picker.status.disabled"
)
: entry.hidden_by
? this.hass.localize(
"ui.panel.config.entities.picker.status.hidden"
)
: this.hass.localize(
"ui.panel.config.entities.picker.status.readonly"
)}
</simple-tooltip>
</div>
`
@ -426,10 +426,10 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
status: restored
? localize("ui.panel.config.entities.picker.status.restored")
: unavailable
? localize("ui.panel.config.entities.picker.status.unavailable")
: entry.disabled_by
? localize("ui.panel.config.entities.picker.status.disabled")
: localize("ui.panel.config.entities.picker.status.ok"),
? localize("ui.panel.config.entities.picker.status.unavailable")
: entry.disabled_by
? localize("ui.panel.config.entities.picker.status.disabled")
: localize("ui.panel.config.entities.picker.status.ok"),
});
}

View File

@ -439,16 +439,16 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
</div>
</ha-card>`
: isComponentLoaded(this.hass, "hardware")
? html`<ha-card outlined>
<div class="card-content">
<div class="value">
${this.hass.localize(
"ui.panel.config.hardware.loading_system_data"
)}
? html`<ha-card outlined>
<div class="card-content">
<div class="value">
${this.hass.localize(
"ui.panel.config.hardware.loading_system_data"
)}
</div>
</div>
</div>
</ha-card>`
: ""}
</ha-card>`
: ""}
</div>
</hass-subpage>
`;

View File

@ -161,8 +161,8 @@ class HaCounterForm extends LitElement {
? Number(target.value)
: undefined
: target.localName === "ha-switch"
? (ev.target as HaSwitch).checked
: ev.detail?.value || target.value;
? (ev.target as HaSwitch).checked
: ev.detail?.value || target.value;
if (this[`_${configValue}`] === value) {
return;
}

View File

@ -33,8 +33,8 @@ class HaInputDateTimeForm extends LitElement {
item.has_time && item.has_date
? "datetime"
: item.has_time
? "time"
: "date";
? "time"
: "date";
this._item.has_date =
!item.has_date && !item.has_time ? true : item.has_date;
} else {

View File

@ -684,25 +684,25 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
${this.hass.localize("ui.common.enable")}
</mwc-button>`
: configPanel &&
(item.domain !== "matter" || isDevVersion(this.hass.config.version))
? html`<a
slot="meta"
href=${`/${configPanel}?config_entry=${item.entry_id}`}
><mwc-button>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.configure"
)}
</mwc-button></a
>`
: item.supports_options && !stateText
? html`
<mwc-button slot="meta" @click=${this._showOptions}>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.configure"
)}
</mwc-button>
`
: ""}
(item.domain !== "matter" || isDevVersion(this.hass.config.version))
? html`<a
slot="meta"
href=${`/${configPanel}?config_entry=${item.entry_id}`}
><mwc-button>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.configure"
)}
</mwc-button></a
>`
: item.supports_options && !stateText
? html`
<mwc-button slot="meta" @click=${this._showOptions}>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.configure"
)}
</mwc-button>
`
: ""}
<ha-button-menu slot="meta">
<ha-icon-button
slot="trigger"
@ -835,19 +835,19 @@ class HaConfigIntegrationPage extends SubscribeMixin(LitElement) {
></ha-svg-icon>
</ha-list-item>`
: item.source !== "system"
? html`<ha-list-item
class="warning"
@request-selected=${this._handleDisable}
graphic="icon"
>
${this.hass.localize("ui.common.disable")}
<ha-svg-icon
slot="graphic"
? html`<ha-list-item
class="warning"
.path=${mdiStopCircleOutline}
></ha-svg-icon>
</ha-list-item>`
: ""}
@request-selected=${this._handleDisable}
graphic="icon"
>
${this.hass.localize("ui.common.disable")}
<ha-svg-icon
slot="graphic"
class="warning"
.path=${mdiStopCircleOutline}
></ha-svg-icon>
</ha-list-item>`
: ""}
${item.source !== "system"
? html`<ha-list-item
class="warning"

View File

@ -465,57 +465,60 @@ class HaConfigIntegrationsDashboard extends SubscribeMixin(LitElement) {
></ha-integration-card>`
)
: this._filter &&
!configEntriesInProgress.length &&
!integrations.length &&
this.configEntries.length
? html`
<div class="empty-message">
<h1>
${this.hass.localize(
"ui.panel.config.integrations.none_found"
)}
</h1>
<p>
${this.hass.localize(
"ui.panel.config.integrations.none_found_detail"
)}
</p>
<mwc-button
@click=${this._createFlow}
unelevated
.label=${this.hass.localize(
"ui.panel.config.integrations.add_integration"
)}
></mwc-button>
</div>
`
: // If we have a filter, never show a card
this._filter
? ""
: // If we're showing 0 cards, show empty state text
(!this._showIgnored || ignoredConfigEntries.length === 0) &&
(!this._showDisabled || disabledConfigEntries.length === 0) &&
integrations.length === 0
? html`
<div class="empty-message">
<h1>
${this.hass.localize("ui.panel.config.integrations.none")}
</h1>
<p>
${this.hass.localize(
"ui.panel.config.integrations.no_integrations"
)}
</p>
<mwc-button
@click=${this._createFlow}
unelevated
.label=${this.hass.localize(
"ui.panel.config.integrations.add_integration"
)}
></mwc-button>
</div>
`
: ""}
!configEntriesInProgress.length &&
!integrations.length &&
this.configEntries.length
? html`
<div class="empty-message">
<h1>
${this.hass.localize(
"ui.panel.config.integrations.none_found"
)}
</h1>
<p>
${this.hass.localize(
"ui.panel.config.integrations.none_found_detail"
)}
</p>
<mwc-button
@click=${this._createFlow}
unelevated
.label=${this.hass.localize(
"ui.panel.config.integrations.add_integration"
)}
></mwc-button>
</div>
`
: // If we have a filter, never show a card
this._filter
? ""
: // If we're showing 0 cards, show empty state text
(!this._showIgnored || ignoredConfigEntries.length === 0) &&
(!this._showDisabled ||
disabledConfigEntries.length === 0) &&
integrations.length === 0
? html`
<div class="empty-message">
<h1>
${this.hass.localize(
"ui.panel.config.integrations.none"
)}
</h1>
<p>
${this.hass.localize(
"ui.panel.config.integrations.no_integrations"
)}
</p>
<mwc-button
@click=${this._createFlow}
unelevated
.label=${this.hass.localize(
"ui.panel.config.integrations.add_integration"
)}
></mwc-button>
</div>
`
: ""}
</div>
<ha-fab
slot="fab"

View File

@ -105,10 +105,10 @@ export class HaIntegrationCard extends LitElement {
`ui.panel.config.integrations.config_entry.state.${entryState}`
)
: debugLoggingEnabled
? this.hass.localize(
"ui.panel.config.integrations.config_entry.debug_logging_enabled"
)
: undefined}
? this.hass.localize(
"ui.panel.config.integrations.config_entry.debug_logging_enabled"
)
: undefined}
.manifest=${this.manifest}
>
</ha-integration-header>
@ -146,26 +146,26 @@ export class HaIntegrationCard extends LitElement {
</ha-button>
</a>`
: entities.length > 0
? html`<a
href=${`/config/entities?historyBack=1&domain=${this.domain}`}
>
<ha-button>
${this.hass.localize(
`ui.panel.config.integrations.config_entry.entities`,
"count",
entities.length
)}
</ha-button>
</a>`
: html`<a href=${`/config/integrations/integration/${this.domain}`}>
<ha-button>
${this.hass.localize(
`ui.panel.config.integrations.config_entry.entries`,
"count",
this.items.length
)}
</ha-button>
</a>`}
? html`<a
href=${`/config/entities?historyBack=1&domain=${this.domain}`}
>
<ha-button>
${this.hass.localize(
`ui.panel.config.integrations.config_entry.entities`,
"count",
entities.length
)}
</ha-button>
</a>`
: html`<a href=${`/config/integrations/integration/${this.domain}`}>
<ha-button>
${this.hass.localize(
`ui.panel.config.integrations.config_entry.entries`,
"count",
this.items.length
)}
</ha-button>
</a>`}
<div class="icons">
${this.manifest && !this.manifest.is_built_in
? html`<span class="icon custom">

View File

@ -56,13 +56,13 @@ export class HaIntegrationHeader extends LitElement {
</div>
`
: this.warning
? html`
<div class="secondary warning">
<ha-svg-icon .path=${mdiAlertOutline}></ha-svg-icon>
<span>${this.warning}</span>
</div>
`
: nothing}
? html`
<div class="secondary warning">
<ha-svg-icon .path=${mdiAlertOutline}></ha-svg-icon>
<span>${this.warning}</span>
</div>
`
: nothing}
</div>
<ha-icon-next
class="header-button"

View File

@ -140,40 +140,40 @@ class DialogZHAManageZigbeeDevice extends LitElement {
></zha-manage-clusters>
`
: this._currTab === "bindings"
? html`
${this._bindableDevices.length > 0
? html`
<zha-device-binding-control
.hass=${this.hass}
.device=${this._device}
.bindableDevices=${this._bindableDevices}
></zha-device-binding-control>
`
: ""}
${this._device && this._groups.length > 0
? html`
<zha-group-binding-control
.hass=${this.hass}
.device=${this._device}
.groups=${this._groups}
></zha-group-binding-control>
`
: ""}
`
: this._currTab === "signature"
? html`
<zha-device-zigbee-info
.hass=${this.hass}
.device=${this._device}
></zha-device-zigbee-info>
`
: html`
<zha-device-neighbors
.hass=${this.hass}
.device=${this._device}
.narrow=${!this.large}
></zha-device-neighbors>
`
? html`
${this._bindableDevices.length > 0
? html`
<zha-device-binding-control
.hass=${this.hass}
.device=${this._device}
.bindableDevices=${this._bindableDevices}
></zha-device-binding-control>
`
: ""}
${this._device && this._groups.length > 0
? html`
<zha-group-binding-control
.hass=${this.hass}
.device=${this._device}
.groups=${this._groups}
></zha-group-binding-control>
`
: ""}
`
: this._currTab === "signature"
? html`
<zha-device-zigbee-info
.hass=${this.hass}
.device=${this._device}
></zha-device-zigbee-info>
`
: html`
<zha-device-neighbors
.hass=${this.hass}
.device=${this._device}
.narrow=${!this.large}
></zha-device-neighbors>
`
)}
</div>
</ha-dialog>

View File

@ -119,76 +119,80 @@ class DialogZWaveJSAddNode extends LitElement {
<ha-circular-progress size="large" active></ha-circular-progress>
</div>`
: this._status === "choose_strategy"
? html`<h3>Choose strategy</h3>
<div class="flex-column">
<ha-formfield
.label=${html`<b>Secure if possible</b>
<div class="secondary">
Requires user interaction during inclusion. Fast and
secure with S2 when supported. Fallback to legacy S0 or no
encryption when necessary.
</div>`}
>
<ha-radio
name="strategy"
@change=${this._handleStrategyChange}
.value=${InclusionStrategy.Default}
.checked=${this._inclusionStrategy ===
InclusionStrategy.Default ||
this._inclusionStrategy === undefined}
? html`<h3>Choose strategy</h3>
<div class="flex-column">
<ha-formfield
.label=${html`<b>Secure if possible</b>
<div class="secondary">
Requires user interaction during inclusion. Fast and
secure with S2 when supported. Fallback to legacy S0 or
no encryption when necessary.
</div>`}
>
</ha-radio>
</ha-formfield>
<ha-formfield
.label=${html`<b>Legacy Secure</b>
<div class="secondary">
Uses the older S0 security that is secure, but slow due to
a lot of overhead. Allows securely including S2 capable
devices which fail to be included with S2.
</div>`}
>
<ha-radio
name="strategy"
@change=${this._handleStrategyChange}
.value=${InclusionStrategy.Security_S0}
.checked=${this._inclusionStrategy ===
InclusionStrategy.Security_S0}
<ha-radio
name="strategy"
@change=${this._handleStrategyChange}
.value=${InclusionStrategy.Default}
.checked=${this._inclusionStrategy ===
InclusionStrategy.Default ||
this._inclusionStrategy === undefined}
>
</ha-radio>
</ha-formfield>
<ha-formfield
.label=${html`<b>Legacy Secure</b>
<div class="secondary">
Uses the older S0 security that is secure, but slow due
to a lot of overhead. Allows securely including S2
capable devices which fail to be included with S2.
</div>`}
>
</ha-radio>
</ha-formfield>
<ha-formfield
.label=${html`<b>Insecure</b>
<div class="secondary">Do not use encryption.</div>`}
>
<ha-radio
name="strategy"
@change=${this._handleStrategyChange}
.value=${InclusionStrategy.Insecure}
.checked=${this._inclusionStrategy ===
InclusionStrategy.Insecure}
<ha-radio
name="strategy"
@change=${this._handleStrategyChange}
.value=${InclusionStrategy.Security_S0}
.checked=${this._inclusionStrategy ===
InclusionStrategy.Security_S0}
>
</ha-radio>
</ha-formfield>
<ha-formfield
.label=${html`<b>Insecure</b>
<div class="secondary">Do not use encryption.</div>`}
>
</ha-radio>
</ha-formfield>
</div>
<mwc-button
slot="primaryAction"
@click=${this._startManualInclusion}
>
Search device
</mwc-button>`
: this._status === "qr_scan"
? html`${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""}
<ha-qr-scanner
.localize=${this.hass.localize}
@qr-code-scanned=${this._qrCodeScanned}
></ha-qr-scanner>
<mwc-button slot="secondaryAction" @click=${this._startOver}>
${this.hass.localize("ui.panel.config.zwave_js.common.back")}
</mwc-button>`
: this._status === "validate_dsk_enter_pin"
? html`
<ha-radio
name="strategy"
@change=${this._handleStrategyChange}
.value=${InclusionStrategy.Insecure}
.checked=${this._inclusionStrategy ===
InclusionStrategy.Insecure}
>
</ha-radio>
</ha-formfield>
</div>
<mwc-button
slot="primaryAction"
@click=${this._startManualInclusion}
>
Search device
</mwc-button>`
: this._status === "qr_scan"
? html`${this._error
? html`<ha-alert alert-type="error"
>${this._error}</ha-alert
>`
: ""}
<ha-qr-scanner
.localize=${this.hass.localize}
@qr-code-scanned=${this._qrCodeScanned}
></ha-qr-scanner>
<mwc-button slot="secondaryAction" @click=${this._startOver}>
${this.hass.localize(
"ui.panel.config.zwave_js.common.back"
)}
</mwc-button>`
: this._status === "validate_dsk_enter_pin"
? html`
<p>
Please enter the 5-digit PIN for your device and verify that
the rest of the device-specific key matches the one that can
@ -217,262 +221,300 @@ class DialogZWaveJSAddNode extends LitElement {
</mwc-button>
</div>
`
: this._status === "grant_security_classes"
? html`
<h3>The device has requested the following security classes:</h3>
${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""}
<div class="flex-column">
${this._requestedGrant?.securityClasses
.sort()
.reverse()
.map(
(securityClass) =>
html`<ha-formfield
.label=${html`<b
>${this.hass.localize(
`ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.title`
)}</b
>
<div class="secondary">
${this.hass.localize(
`ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.description`
)}
</div>`}
>
<ha-checkbox
@change=${this._handleSecurityClassChange}
.value=${securityClass}
.checked=${this._securityClasses.includes(
securityClass
: this._status === "grant_security_classes"
? html`
<h3>
The device has requested the following security classes:
</h3>
${this._error
? html`<ha-alert alert-type="error"
>${this._error}</ha-alert
>`
: ""}
<div class="flex-column">
${this._requestedGrant?.securityClasses
.sort()
.reverse()
.map(
(securityClass) =>
html`<ha-formfield
.label=${html`<b
>${this.hass.localize(
`ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.title`
)}</b
>
<div class="secondary">
${this.hass.localize(
`ui.panel.config.zwave_js.security_classes.${SecurityClass[securityClass]}.description`
)}
</div>`}
>
<ha-checkbox
@change=${this._handleSecurityClassChange}
.value=${securityClass}
.checked=${this._securityClasses.includes(
securityClass
)}
>
</ha-checkbox>
</ha-formfield>`
)}
</div>
<mwc-button
slot="primaryAction"
.disabled=${!this._securityClasses.length}
@click=${this._grantSecurityClasses}
>
Submit
</mwc-button>
`
: this._status === "timed_out"
? html`
<h3>Timed out!</h3>
<p>
We have not found any device in inclusion mode. Make
sure the device is active and in inclusion mode.
</p>
<mwc-button
slot="primaryAction"
@click=${this._startOver}
>
</ha-checkbox>
</ha-formfield>`
)}
</div>
<mwc-button
slot="primaryAction"
.disabled=${!this._securityClasses.length}
@click=${this._grantSecurityClasses}
>
Submit
</mwc-button>
`
: this._status === "timed_out"
? html`
<h3>Timed out!</h3>
<p>
We have not found any device in inclusion mode. Make sure the
device is active and in inclusion mode.
</p>
<mwc-button slot="primaryAction" @click=${this._startOver}>
Retry
</mwc-button>
`
: this._status === "started_specific"
? html`<h3>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.searching_device"
)}
</h3>
<ha-circular-progress active></ha-circular-progress>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.follow_device_instructions"
)}
</p>`
: this._status === "started"
? html`
<div class="select-inclusion">
<div class="outline">
<h2>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.searching_device"
)}
</h2>
<ha-circular-progress active></ha-circular-progress>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.follow_device_instructions"
)}
</p>
<p>
<button
class="link"
@click=${this._chooseInclusionStrategy}
>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.choose_inclusion_strategy"
)}
</button>
</p>
</div>
${this._supportsSmartStart
? html` <div class="outline">
<h2>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.qr_code"
)}
</h2>
<ha-svg-icon .path=${mdiQrcodeScan}></ha-svg-icon>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.qr_code_paragraph"
)}
</p>
<p>
<mwc-button @click=${this._scanQRCode}>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.scan_qr_code"
)}
Retry
</mwc-button>
</p>
</div>`
: ""}
</div>
<mwc-button slot="primaryAction" @click=${this.closeDialog}>
${this.hass.localize("ui.common.cancel")}
</mwc-button>
`
: this._status === "interviewing"
? html`
<div class="flex-container">
<ha-circular-progress active></ha-circular-progress>
<div class="status">
<p>
<b
>${this.hass.localize(
"ui.panel.config.zwave_js.add_node.interview_started"
)}</b
>
</p>
${this._stages
? html` <div class="stages">
${this._stages.map(
(stage) => html`
<span class="stage">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
${stage}
</span>
`
: this._status === "started_specific"
? html`<h3>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.searching_device"
)}
</h3>
<ha-circular-progress active></ha-circular-progress>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.follow_device_instructions"
)}
</p>`
: this._status === "started"
? html`
<div class="select-inclusion">
<div class="outline">
<h2>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.searching_device"
)}
</h2>
<ha-circular-progress
active
></ha-circular-progress>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.follow_device_instructions"
)}
</p>
<p>
<button
class="link"
@click=${this._chooseInclusionStrategy}
>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.choose_inclusion_strategy"
)}
</button>
</p>
</div>
${this._supportsSmartStart
? html` <div class="outline">
<h2>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.qr_code"
)}
</h2>
<ha-svg-icon
.path=${mdiQrcodeScan}
></ha-svg-icon>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.qr_code_paragraph"
)}
</p>
<p>
<mwc-button @click=${this._scanQRCode}>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.scan_qr_code"
)}
</mwc-button>
</p>
</div>`
: ""}
</div>
<mwc-button
slot="primaryAction"
@click=${this.closeDialog}
>
${this.hass.localize("ui.common.cancel")}
</mwc-button>
`
)}
</div>`
: ""}
</div>
</div>
<mwc-button slot="primaryAction" @click=${this.closeDialog}>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "failed"
? html`
<div class="flex-container">
<div class="status">
<ha-alert
alert-type="error"
.title=${this.hass.localize(
"ui.panel.config.zwave_js.add_node.inclusion_failed"
)}
>
${this._error ||
this.hass.localize(
"ui.panel.config.zwave_js.add_node.check_logs"
)}
</ha-alert>
${this._stages
? html` <div class="stages">
${this._stages.map(
(stage) => html`
<span class="stage">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
${stage}
</span>
`
)}
</div>`
: ""}
</div>
</div>
<mwc-button slot="primaryAction" @click=${this.closeDialog}>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "finished"
? html`
<div class="flex-container">
<ha-svg-icon
.path=${this._lowSecurity ? mdiAlertCircle : mdiCheckCircle}
class=${this._lowSecurity ? "warning" : "success"}
></ha-svg-icon>
<div class="status">
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.inclusion_finished"
)}
</p>
${this._lowSecurity
? html`<ha-alert
alert-type="warning"
title="The device was added insecurely"
>
There was an error during secure inclusion. You can try
again by excluding the device and adding it again.
</ha-alert>`
: ""}
<a href=${`/config/devices/device/${this._device!.id}`}>
<mwc-button>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.view_device"
)}
</mwc-button>
</a>
${this._stages
? html` <div class="stages">
${this._stages.map(
(stage) => html`
<span class="stage">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
${stage}
</span>
`
)}
</div>`
: ""}
</div>
</div>
<mwc-button slot="primaryAction" @click=${this.closeDialog}>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "provisioned"
? html` <div class="flex-container">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
<div class="status">
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.provisioning_finished"
)}
</p>
</div>
</div>
<mwc-button slot="primaryAction" @click=${this.closeDialog}>
${this.hass.localize("ui.common.close")}
</mwc-button>`
: ""}
: this._status === "interviewing"
? html`
<div class="flex-container">
<ha-circular-progress
active
></ha-circular-progress>
<div class="status">
<p>
<b
>${this.hass.localize(
"ui.panel.config.zwave_js.add_node.interview_started"
)}</b
>
</p>
${this._stages
? html` <div class="stages">
${this._stages.map(
(stage) => html`
<span class="stage">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
${stage}
</span>
`
)}
</div>`
: ""}
</div>
</div>
<mwc-button
slot="primaryAction"
@click=${this.closeDialog}
>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "failed"
? html`
<div class="flex-container">
<div class="status">
<ha-alert
alert-type="error"
.title=${this.hass.localize(
"ui.panel.config.zwave_js.add_node.inclusion_failed"
)}
>
${this._error ||
this.hass.localize(
"ui.panel.config.zwave_js.add_node.check_logs"
)}
</ha-alert>
${this._stages
? html` <div class="stages">
${this._stages.map(
(stage) => html`
<span class="stage">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
${stage}
</span>
`
)}
</div>`
: ""}
</div>
</div>
<mwc-button
slot="primaryAction"
@click=${this.closeDialog}
>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "finished"
? html`
<div class="flex-container">
<ha-svg-icon
.path=${this._lowSecurity
? mdiAlertCircle
: mdiCheckCircle}
class=${this._lowSecurity
? "warning"
: "success"}
></ha-svg-icon>
<div class="status">
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.inclusion_finished"
)}
</p>
${this._lowSecurity
? html`<ha-alert
alert-type="warning"
title="The device was added insecurely"
>
There was an error during secure
inclusion. You can try again by
excluding the device and adding it
again.
</ha-alert>`
: ""}
<a
href=${`/config/devices/device/${
this._device!.id
}`}
>
<mwc-button>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.view_device"
)}
</mwc-button>
</a>
${this._stages
? html` <div class="stages">
${this._stages.map(
(stage) => html`
<span class="stage">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
${stage}
</span>
`
)}
</div>`
: ""}
</div>
</div>
<mwc-button
slot="primaryAction"
@click=${this.closeDialog}
>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "provisioned"
? html` <div class="flex-container">
<ha-svg-icon
.path=${mdiCheckCircle}
class="success"
></ha-svg-icon>
<div class="status">
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.add_node.provisioning_finished"
)}
</p>
</div>
</div>
<mwc-button
slot="primaryAction"
@click=${this.closeDialog}
>
${this.hass.localize("ui.common.close")}
</mwc-button>`
: ""}
</ha-dialog>
`;
}

View File

@ -215,77 +215,77 @@ class DialogZWaveJSUpdateFirmwareNode extends LitElement {
${abortFirmwareUpdateButton}
`
: this._updateProgressMessage && !this._updateFinishedMessage
? html`
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.update_firmware.in_progress",
{
device: html`<strong>${this._deviceName}</strong>`,
progress: (
(this._updateProgressMessage.sent_fragments * 100) /
this._updateProgressMessage.total_fragments
).toFixed(2),
}
)}
</p>
<mwc-linear-progress
determinate
.progress=${this._updateProgressMessage.sent_fragments /
this._updateProgressMessage.total_fragments}
></mwc-linear-progress>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.update_firmware.close",
{
device: html`<strong>${this._deviceName}</strong>`,
}
)}
</p>
${abortFirmwareUpdateButton}
`
: html`
<div class="flex-container">
<ha-svg-icon
.path=${this._updateFinishedMessage!.success
? mdiCheckCircle
: mdiCloseCircle}
.class=${status}
></ha-svg-icon>
<div class="status">
<p>
${this.hass.localize(
`ui.panel.config.zwave_js.update_firmware.finished_status.${status}`,
{
device: html`<strong>${this._deviceName}</strong>`,
message: this.hass.localize(
`ui.panel.config.zwave_js.update_firmware.finished_status.${
this._nodeStatus.is_controller_node
? ControllerFirmwareUpdateStatus[
this._updateFinishedMessage!.status
]
: NodeFirmwareUpdateStatus[
this._updateFinishedMessage!.status
]
}`
),
}
)}
</p>
</div>
</div>
${this._updateFinishedMessage!.success
? html`<p>
${this.hass.localize(
`ui.panel.config.zwave_js.update_firmware.finished_status.done${localizationKeySuffix}`
)}
</p>`
: html`<p>
? html`
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.update_firmware.in_progress",
{
device: html`<strong>${this._deviceName}</strong>`,
progress: (
(this._updateProgressMessage.sent_fragments * 100) /
this._updateProgressMessage.total_fragments
).toFixed(2),
}
)}
</p>
<mwc-linear-progress
determinate
.progress=${this._updateProgressMessage.sent_fragments /
this._updateProgressMessage.total_fragments}
></mwc-linear-progress>
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.update_firmware.close",
{
device: html`<strong>${this._deviceName}</strong>`,
}
)}
</p>
${abortFirmwareUpdateButton}
`
: html`
<div class="flex-container">
<ha-svg-icon
.path=${this._updateFinishedMessage!.success
? mdiCheckCircle
: mdiCloseCircle}
.class=${status}
></ha-svg-icon>
<div class="status">
<p>
${this.hass.localize(
"ui.panel.config.zwave_js.update_firmware.finished_status.try_again"
`ui.panel.config.zwave_js.update_firmware.finished_status.${status}`,
{
device: html`<strong>${this._deviceName}</strong>`,
message: this.hass.localize(
`ui.panel.config.zwave_js.update_firmware.finished_status.${
this._nodeStatus.is_controller_node
? ControllerFirmwareUpdateStatus[
this._updateFinishedMessage!.status
]
: NodeFirmwareUpdateStatus[
this._updateFinishedMessage!.status
]
}`
),
}
)}
</p>
${beginFirmwareUpdateHTML}`}
`}
</div>
</div>
${this._updateFinishedMessage!.success
? html`<p>
${this.hass.localize(
`ui.panel.config.zwave_js.update_firmware.finished_status.done${localizationKeySuffix}`
)}
</p>`
: html`<p>
${this.hass.localize(
"ui.panel.config.zwave_js.update_firmware.finished_status.try_again"
)}
</p>
${beginFirmwareUpdateHTML}`}
`}
</ha-dialog>
`;
}

View File

@ -119,45 +119,45 @@ export class SystemLogCard extends LitElement {
</div>
`
: filteredItems.length === 0 && this.filter
? html`<div class="card-content">
${this.hass.localize(
"ui.panel.config.logs.no_issues_search",
"term",
this.filter
? html`<div class="card-content">
${this.hass.localize(
"ui.panel.config.logs.no_issues_search",
"term",
this.filter
)}
</div>`
: filteredItems.map(
(item, idx) => html`
<paper-item @click=${this._openLog} .logItem=${item}>
<paper-item-body two-line>
<div class="row">${item.message[0]}</div>
<div class="row-secondary" secondary>
${this._timestamp(item)}
${html`(<span class=${item.level}
>${this.hass.localize(
`ui.panel.config.logs.level.${item.level}`
)}</span
>) `}
${integrations[idx]
? `${domainToName(
this.hass!.localize,
integrations[idx]!
)}${
isCustomIntegrationError(item)
? ` (${this.hass.localize(
"ui.panel.config.logs.custom_integration"
)})`
: ""
}`
: item.source[0]}
${item.count > 1
? html` - ${this._multipleMessages(item)} `
: nothing}
</div>
</paper-item-body>
</paper-item>
`
)}
</div>`
: filteredItems.map(
(item, idx) => html`
<paper-item @click=${this._openLog} .logItem=${item}>
<paper-item-body two-line>
<div class="row">${item.message[0]}</div>
<div class="row-secondary" secondary>
${this._timestamp(item)}
${html`(<span class=${item.level}
>${this.hass.localize(
`ui.panel.config.logs.level.${item.level}`
)}</span
>) `}
${integrations[idx]
? `${domainToName(
this.hass!.localize,
integrations[idx]!
)}${
isCustomIntegrationError(item)
? ` (${this.hass.localize(
"ui.panel.config.logs.custom_integration"
)})`
: ""
}`
: item.source[0]}
${item.count > 1
? html` - ${this._multipleMessages(item)} `
: nothing}
</div>
</paper-item-body>
</paper-item>
`
)}
<div class="card-actions">
<ha-call-service-button

View File

@ -86,19 +86,19 @@ export class DialogLovelaceDashboardDetail extends LitElement {
"ui.panel.config.lovelace.dashboards.cant_edit_yaml"
)
: this._params.urlPath === "lovelace"
? this.hass.localize(
"ui.panel.config.lovelace.dashboards.cant_edit_default"
)
: html`
<ha-form
.schema=${this._schema(this._params, this.hass.userData)}
.data=${this._data}
.hass=${this.hass}
.error=${this._error}
.computeLabel=${this._computeLabel}
@value-changed=${this._valueChanged}
></ha-form>
`}
? this.hass.localize(
"ui.panel.config.lovelace.dashboards.cant_edit_default"
)
: html`
<ha-form
.schema=${this._schema(this._params, this.hass.userData)}
.data=${this._data}
.hass=${this.hass}
.error=${this._error}
.computeLabel=${this._computeLabel}
@value-changed=${this._valueChanged}
></ha-form>
`}
</div>
${this._params.urlPath
? html`
@ -208,8 +208,8 @@ export class DialogLovelaceDashboardDetail extends LitElement {
entry.name === "show_in_sidebar"
? "show_sidebar"
: entry.name === "url_path"
? "url"
: entry.name
? "url"
: entry.name
}`
);

View File

@ -405,24 +405,24 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
</div>
`
: this._mode === "yaml"
? html`
<ha-yaml-editor
.hass=${this.hass}
.defaultValue=${this._preprocessYaml()}
.readOnly=${this._readOnly}
@value-changed=${this._yamlChanged}
></ha-yaml-editor>
<ha-card outlined>
<div class="card-actions">
<mwc-button @click=${this._copyYaml}>
${this.hass.localize(
"ui.panel.config.automation.editor.copy_to_clipboard"
)}
</mwc-button>
</div>
</ha-card>
`
: ``}
? html`
<ha-yaml-editor
.hass=${this.hass}
.defaultValue=${this._preprocessYaml()}
.readOnly=${this._readOnly}
@value-changed=${this._yamlChanged}
></ha-yaml-editor>
<ha-card outlined>
<div class="card-actions">
<mwc-button @click=${this._copyYaml}>
${this.hass.localize(
"ui.panel.config.automation.editor.copy_to_clipboard"
)}
</mwc-button>
</div>
</ha-card>
`
: ``}
</div>
<ha-fab
slot="fab"

View File

@ -210,104 +210,104 @@ export class HaScriptTrace extends LitElement {
${this._traces === undefined
? html`<div class="container">Loading…</div>`
: this._traces.length === 0
? html`<div class="container">No traces found</div>`
: this._trace === undefined
? ""
: html`
<div class="main">
<div class="graph">
<hat-script-graph
.trace=${this._trace}
.selected=${this._selected?.path}
@graph-node-selected=${this._pickNode}
></hat-script-graph>
</div>
? html`<div class="container">No traces found</div>`
: this._trace === undefined
? ""
: html`
<div class="main">
<div class="graph">
<hat-script-graph
.trace=${this._trace}
.selected=${this._selected?.path}
@graph-node-selected=${this._pickNode}
></hat-script-graph>
</div>
<div class="info">
<div class="tabs top">
${[
["details", "Step Details"],
["timeline", "Trace Timeline"],
["logbook", "Related logbook entries"],
["config", "Script Config"],
].map(
([view, label]) => html`
<button
tabindex="0"
.view=${view}
class=${classMap({ active: this._view === view })}
@click=${this._showTab}
>
${label}
</button>
`
)}
${this._trace.blueprint_inputs
? html`
<button
tabindex="0"
.view=${"blueprint"}
class=${classMap({
active: this._view === "blueprint",
})}
@click=${this._showTab}
>
Blueprint Config
</button>
`
: ""}
<div class="info">
<div class="tabs top">
${[
["details", "Step Details"],
["timeline", "Trace Timeline"],
["logbook", "Related logbook entries"],
["config", "Script Config"],
].map(
([view, label]) => html`
<button
tabindex="0"
.view=${view}
class=${classMap({ active: this._view === view })}
@click=${this._showTab}
>
${label}
</button>
`
)}
${this._trace.blueprint_inputs
? html`
<button
tabindex="0"
.view=${"blueprint"}
class=${classMap({
active: this._view === "blueprint",
})}
@click=${this._showTab}
>
Blueprint Config
</button>
`
: ""}
</div>
${this._selected === undefined ||
this._logbookEntries === undefined ||
trackedNodes === undefined
? ""
: this._view === "details"
? html`
<ha-trace-path-details
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.selected=${this._selected}
.logbookEntries=${this._logbookEntries}
.trackedNodes=${trackedNodes}
.renderedNodes=${renderedNodes!}
></ha-trace-path-details>
`
: this._view === "config"
? html`
<ha-trace-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-config>
`
: this._view === "logbook"
? html`
<ha-trace-logbook
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
></ha-trace-logbook>
`
: this._view === "blueprint"
? html`
<ha-trace-blueprint-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-blueprint-config>
`
: html`
<ha-trace-timeline
.hass=${this.hass}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
.selected=${this._selected}
@value-changed=${this._timelinePathPicked}
></ha-trace-timeline>
`}
</div>
</div>
${this._selected === undefined ||
this._logbookEntries === undefined ||
trackedNodes === undefined
? ""
: this._view === "details"
? html`
<ha-trace-path-details
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.selected=${this._selected}
.logbookEntries=${this._logbookEntries}
.trackedNodes=${trackedNodes}
.renderedNodes=${renderedNodes!}
></ha-trace-path-details>
`
: this._view === "config"
? html`
<ha-trace-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-config>
`
: this._view === "logbook"
? html`
<ha-trace-logbook
.hass=${this.hass}
.narrow=${this.narrow}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
></ha-trace-logbook>
`
: this._view === "blueprint"
? html`
<ha-trace-blueprint-config
.hass=${this.hass}
.trace=${this._trace}
></ha-trace-blueprint-config>
`
: html`
<ha-trace-timeline
.hass=${this.hass}
.trace=${this._trace}
.logbookEntries=${this._logbookEntries}
.selected=${this._selected}
@value-changed=${this._timelinePathPicked}
></ha-trace-timeline>
`}
</div>
</div>
`}
`}
</hass-subpage>
`;
}

View File

@ -92,59 +92,59 @@ const mountSchema = memoizeOne(
},
] as const)
: mountType === "cifs"
? ([
...(showCIFSVersion
? ([
{
name: "version",
required: true,
selector: {
select: {
options: [
{
label: localize(
"ui.panel.config.storage.network_mounts.cifs_versions.auto"
),
value: "auto",
},
{
label: localize(
"ui.panel.config.storage.network_mounts.cifs_versions.legacy",
{ version: "2.0" }
),
value: "2.0",
},
{
label: localize(
"ui.panel.config.storage.network_mounts.cifs_versions.legacy",
{ version: "1.0" }
),
value: "1.0",
},
],
mode: "dropdown",
? ([
...(showCIFSVersion
? ([
{
name: "version",
required: true,
selector: {
select: {
options: [
{
label: localize(
"ui.panel.config.storage.network_mounts.cifs_versions.auto"
),
value: "auto",
},
{
label: localize(
"ui.panel.config.storage.network_mounts.cifs_versions.legacy",
{ version: "2.0" }
),
value: "2.0",
},
{
label: localize(
"ui.panel.config.storage.network_mounts.cifs_versions.legacy",
{ version: "1.0" }
),
value: "1.0",
},
],
mode: "dropdown",
},
},
},
},
] as const)
: ([] as const)),
{
name: "share",
required: true,
selector: { text: {} },
},
{
name: "username",
required: false,
selector: { text: {} },
},
{
name: "password",
required: false,
selector: { text: { type: "password" } },
},
] as const)
: ([] as const)),
] as const)
: ([] as const)),
{
name: "share",
required: true,
selector: { text: {} },
},
{
name: "username",
required: false,
selector: { text: {} },
},
{
name: "password",
required: false,
selector: { text: { type: "password" } },
},
] as const)
: ([] as const)),
] as const
);

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