Bump typescript, lint, prettier (#10108)
This commit is contained in:
parent
ff2bf1f3c1
commit
2936865c55
|
@ -1,9 +1,10 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
|
"airbnb-base",
|
||||||
"airbnb-typescript/base",
|
"airbnb-typescript/base",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:wc/recommended",
|
"plugin:wc/recommended",
|
||||||
"plugin:lit/recommended",
|
"plugin:lit/all",
|
||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
|
@ -109,7 +110,9 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"unused-imports/no-unused-imports": "error",
|
"unused-imports/no-unused-imports": "error",
|
||||||
"lit/attribute-value-entities": "off"
|
"lit/attribute-value-entities": "off",
|
||||||
|
"lit/no-template-map": "off",
|
||||||
|
"lit/no-template-arrow": "warn"
|
||||||
},
|
},
|
||||||
"plugins": ["disable", "unused-imports"],
|
"plugins": ["disable", "unused-imports"],
|
||||||
"processor": "disable/disable"
|
"processor": "disable/disable"
|
||||||
|
|
|
@ -191,7 +191,7 @@ class HcCast extends LitElement {
|
||||||
}
|
}
|
||||||
this.connection.close();
|
this.connection.close();
|
||||||
location.reload();
|
location.reload();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert("Unable to log out!");
|
alert("Unable to log out!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ export class HcConnect extends LitElement {
|
||||||
let url: URL;
|
let url: URL;
|
||||||
try {
|
try {
|
||||||
url = new URL(value);
|
url = new URL(value);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this.error = "Invalid URL";
|
this.error = "Invalid URL";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ export class HcConnect extends LitElement {
|
||||||
try {
|
try {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
auth = await getAuth(options);
|
auth = await getAuth(options);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (init === "saved-tokens" && err === ERR_CANNOT_CONNECT) {
|
if (init === "saved-tokens" && err === ERR_CANNOT_CONNECT) {
|
||||||
this.cannotConnect = true;
|
this.cannotConnect = true;
|
||||||
return;
|
return;
|
||||||
|
@ -259,7 +259,7 @@ export class HcConnect extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
conn = await createConnection({ auth });
|
conn = await createConnection({ auth });
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// In case of saved tokens, silently solve problems.
|
// In case of saved tokens, silently solve problems.
|
||||||
if (init === "saved-tokens") {
|
if (init === "saved-tokens") {
|
||||||
if (err === ERR_CANNOT_CONNECT) {
|
if (err === ERR_CANNOT_CONNECT) {
|
||||||
|
@ -285,7 +285,7 @@ export class HcConnect extends LitElement {
|
||||||
try {
|
try {
|
||||||
saveTokens(null);
|
saveTokens(null);
|
||||||
location.reload();
|
location.reload();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert("Unable to log out!");
|
alert("Unable to log out!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,14 +148,14 @@ export class HcMain extends HassElement {
|
||||||
expires_in: 0,
|
expires_in: 0,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this._getErrorMessage(err);
|
this._error = this._getErrorMessage(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let connection;
|
let connection;
|
||||||
try {
|
try {
|
||||||
connection = await createConnection({ auth });
|
connection = await createConnection({ auth });
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this._getErrorMessage(err);
|
this._error = this._getErrorMessage(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ export class HcMain extends HassElement {
|
||||||
this._unsubLovelace = llColl.subscribe((lovelaceConfig) =>
|
this._unsubLovelace = llColl.subscribe((lovelaceConfig) =>
|
||||||
this._handleNewLovelaceConfig(lovelaceConfig)
|
this._handleNewLovelaceConfig(lovelaceConfig)
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.log("Error fetching Lovelace configuration", err, msg);
|
console.log("Error fetching Lovelace configuration", err, msg);
|
||||||
// Generate a Lovelace config.
|
// Generate a Lovelace config.
|
||||||
|
|
|
@ -44,7 +44,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
||||||
(conf) => html`
|
(conf) => html`
|
||||||
${conf.name}
|
${conf.name}
|
||||||
<small>
|
<small>
|
||||||
<a target="_blank" href="${conf.authorUrl}">
|
<a target="_blank" href=${conf.authorUrl}>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.page-demo.cards.demo.demo_by",
|
"ui.panel.page-demo.cards.demo.demo_by",
|
||||||
"name",
|
"name",
|
||||||
|
@ -94,7 +94,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
||||||
this._switching = true;
|
this._switching = true;
|
||||||
try {
|
try {
|
||||||
await setDemoConfig(this.hass, this.lovelace!, index);
|
await setDemoConfig(this.hass, this.lovelace!, index);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert("Failed to switch config :-(");
|
alert("Failed to switch config :-(");
|
||||||
} finally {
|
} finally {
|
||||||
this._switching = false;
|
this._switching = false;
|
||||||
|
|
|
@ -23,9 +23,9 @@ customElements.whenDefined("hui-view").then(() => {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
const HUIView = customElements.get("hui-view");
|
const HUIView = customElements.get("hui-view");
|
||||||
// Patch HUI-VIEW to make the lovelace object available to the demo card
|
// Patch HUI-VIEW to make the lovelace object available to the demo card
|
||||||
const oldCreateCard = HUIView.prototype.createCardElement;
|
const oldCreateCard = HUIView!.prototype.createCardElement;
|
||||||
|
|
||||||
HUIView.prototype.createCardElement = function (config) {
|
HUIView!.prototype.createCardElement = function (config) {
|
||||||
const el = oldCreateCard.call(this, config);
|
const el = oldCreateCard.call(this, config);
|
||||||
if (el.tagName === "HA-DEMO-CARD") {
|
if (el.tagName === "HA-DEMO-CARD") {
|
||||||
(el as HADemoCard).lovelace = this.lovelace;
|
(el as HADemoCard).lovelace = this.lovelace;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import { html, LitElement, TemplateResult } from "lit";
|
import { css, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
import "../../../src/components/ha-card";
|
import "../../../src/components/ha-card";
|
||||||
import { ActionHandlerEvent } from "../../../src/data/lovelace";
|
import { ActionHandlerEvent } from "../../../src/data/lovelace";
|
||||||
|
@ -9,7 +9,6 @@ import { actionHandler } from "../../../src/panels/lovelace/common/directives/ac
|
||||||
export class DemoUtilLongPress extends LitElement {
|
export class DemoUtilLongPress extends LitElement {
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
|
||||||
${[1, 2, 3].map(
|
${[1, 2, 3].map(
|
||||||
() => html`
|
() => html`
|
||||||
<ha-card>
|
<ha-card>
|
||||||
|
@ -41,26 +40,22 @@ export class DemoUtilLongPress extends LitElement {
|
||||||
area.scrollTop = area.scrollHeight;
|
area.scrollTop = area.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderStyle() {
|
static styles = css`
|
||||||
return html`
|
ha-card {
|
||||||
<style>
|
width: 200px;
|
||||||
ha-card {
|
margin: calc(42vh - 140px) auto;
|
||||||
width: 200px;
|
padding: 8px;
|
||||||
margin: calc(42vh - 140px) auto;
|
text-align: center;
|
||||||
padding: 8px;
|
}
|
||||||
text-align: center;
|
ha-card:first-of-type {
|
||||||
}
|
margin-top: 16px;
|
||||||
ha-card:first-of-type {
|
}
|
||||||
margin-top: 16px;
|
ha-card:last-of-type {
|
||||||
}
|
margin-bottom: 16px;
|
||||||
ha-card:last-of-type {
|
}
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
}
|
}
|
||||||
</style>
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,7 +259,7 @@ class HassioAddonConfig extends LitElement {
|
||||||
path: "options",
|
path: "options",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.common.update_available",
|
"addon.common.update_available",
|
||||||
"error",
|
"error",
|
||||||
|
@ -300,7 +300,7 @@ class HassioAddonConfig extends LitElement {
|
||||||
if (this.addon?.state === "started") {
|
if (this.addon?.state === "started") {
|
||||||
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_save",
|
"addon.failed_to_save",
|
||||||
"error",
|
"error",
|
||||||
|
|
|
@ -89,9 +89,9 @@ class HassioAddonNetwork extends LitElement {
|
||||||
<td>
|
<td>
|
||||||
<paper-input
|
<paper-input
|
||||||
@value-changed=${this._configChanged}
|
@value-changed=${this._configChanged}
|
||||||
placeholder="${this.supervisor.localize(
|
placeholder=${this.supervisor.localize(
|
||||||
"addon.configuration.network.disabled"
|
"addon.configuration.network.disabled"
|
||||||
)}"
|
)}
|
||||||
.value=${item.host ? String(item.host) : ""}
|
.value=${item.host ? String(item.host) : ""}
|
||||||
.container=${item.container}
|
.container=${item.container}
|
||||||
no-label-float
|
no-label-float
|
||||||
|
@ -171,7 +171,7 @@ class HassioAddonNetwork extends LitElement {
|
||||||
if (this.addon?.state === "started") {
|
if (this.addon?.state === "started") {
|
||||||
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_reset",
|
"addon.failed_to_reset",
|
||||||
"error",
|
"error",
|
||||||
|
@ -207,7 +207,7 @@ class HassioAddonNetwork extends LitElement {
|
||||||
if (this.addon?.state === "started") {
|
if (this.addon?.state === "started") {
|
||||||
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_save",
|
"addon.failed_to_save",
|
||||||
"error",
|
"error",
|
||||||
|
|
|
@ -79,7 +79,7 @@ class HassioAddonDocumentationDashboard extends LitElement {
|
||||||
this.hass,
|
this.hass,
|
||||||
this.addon!.slug
|
this.addon!.slug
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.documentation.get_logs",
|
"addon.documentation.get_logs",
|
||||||
"error",
|
"error",
|
||||||
|
|
|
@ -222,7 +222,7 @@ class HassioAddonDashboard extends LitElement {
|
||||||
try {
|
try {
|
||||||
const addoninfo = await fetchHassioAddonInfo(this.hass, addon);
|
const addoninfo = await fetchHassioAddonInfo(this.hass, addon);
|
||||||
this.addon = addoninfo;
|
this.addon = addoninfo;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = `Error fetching addon info: ${extractApiErrorMessage(err)}`;
|
this._error = `Error fetching addon info: ${extractApiErrorMessage(err)}`;
|
||||||
this.addon = undefined;
|
this.addon = undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,18 +123,18 @@ class HassioAddonInfo extends LitElement {
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<hassio-card-content
|
<hassio-card-content
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.title="${this.supervisor.localize(
|
.title=${this.supervisor.localize(
|
||||||
"addon.dashboard.new_update_available",
|
"addon.dashboard.new_update_available",
|
||||||
"name",
|
"name",
|
||||||
this.addon.name,
|
this.addon.name,
|
||||||
"version",
|
"version",
|
||||||
this.addon.version_latest
|
this.addon.version_latest
|
||||||
)}"
|
)}
|
||||||
.description="${this.supervisor.localize(
|
.description=${this.supervisor.localize(
|
||||||
"common.running_version",
|
"common.running_version",
|
||||||
"version",
|
"version",
|
||||||
this.addon.version
|
this.addon.version
|
||||||
)}"
|
)}
|
||||||
icon=${mdiArrowUpBoldCircle}
|
icon=${mdiArrowUpBoldCircle}
|
||||||
iconClass="update"
|
iconClass="update"
|
||||||
></hassio-card-content>
|
></hassio-card-content>
|
||||||
|
@ -254,7 +254,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
${this.supervisor.localize(
|
${this.supervisor.localize(
|
||||||
"addon.dashboard.visit_addon_page",
|
"addon.dashboard.visit_addon_page",
|
||||||
"name",
|
"name",
|
||||||
html`<a href="${this.addon.url!}" target="_blank" rel="noreferrer"
|
html`<a href=${this.addon.url!} target="_blank" rel="noreferrer"
|
||||||
>${this.addon.name}</a
|
>${this.addon.name}</a
|
||||||
>`
|
>`
|
||||||
)}
|
)}
|
||||||
|
@ -437,10 +437,10 @@ class HassioAddonInfo extends LitElement {
|
||||||
${this.addon.version
|
${this.addon.version
|
||||||
? html`
|
? html`
|
||||||
<div
|
<div
|
||||||
class="${classMap({
|
class=${classMap({
|
||||||
"addon-options": true,
|
"addon-options": true,
|
||||||
started: this.addon.state === "started",
|
started: this.addon.state === "started",
|
||||||
})}"
|
})}
|
||||||
>
|
>
|
||||||
<ha-settings-row ?three-line=${this.narrow}>
|
<ha-settings-row ?three-line=${this.narrow}>
|
||||||
<span slot="heading">
|
<span slot="heading">
|
||||||
|
@ -796,7 +796,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "option",
|
path: "option",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_save",
|
"addon.failed_to_save",
|
||||||
"error",
|
"error",
|
||||||
|
@ -818,7 +818,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "option",
|
path: "option",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_save",
|
"addon.failed_to_save",
|
||||||
"error",
|
"error",
|
||||||
|
@ -840,7 +840,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "option",
|
path: "option",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_save",
|
"addon.failed_to_save",
|
||||||
"error",
|
"error",
|
||||||
|
@ -862,7 +862,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "security",
|
path: "security",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_save",
|
"addon.failed_to_save",
|
||||||
"error",
|
"error",
|
||||||
|
@ -884,7 +884,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "option",
|
path: "option",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.failed_to_save",
|
"addon.failed_to_save",
|
||||||
"error",
|
"error",
|
||||||
|
@ -912,7 +912,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
title: this.supervisor.localize("addon.dashboard.changelog"),
|
title: this.supervisor.localize("addon.dashboard.changelog"),
|
||||||
content,
|
content,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"addon.dashboard.action_error.get_changelog"
|
"addon.dashboard.action_error.get_changelog"
|
||||||
|
@ -934,7 +934,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "install",
|
path: "install",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("addon.dashboard.action_error.install"),
|
title: this.supervisor.localize("addon.dashboard.action_error.install"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -955,7 +955,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "stop",
|
path: "stop",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("addon.dashboard.action_error.stop"),
|
title: this.supervisor.localize("addon.dashboard.action_error.stop"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -976,7 +976,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "stop",
|
path: "stop",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("addon.dashboard.action_error.restart"),
|
title: this.supervisor.localize("addon.dashboard.action_error.restart"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -1035,7 +1035,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
button.progress = false;
|
button.progress = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: "Failed to validate addon configuration",
|
title: "Failed to validate addon configuration",
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -1053,7 +1053,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "start",
|
path: "start",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("addon.dashboard.action_error.start"),
|
title: this.supervisor.localize("addon.dashboard.action_error.start"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -1091,7 +1091,7 @@ class HassioAddonInfo extends LitElement {
|
||||||
path: "uninstall",
|
path: "uninstall",
|
||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"addon.dashboard.action_error.uninstall"
|
"addon.dashboard.action_error.uninstall"
|
||||||
|
|
|
@ -71,7 +71,7 @@ class HassioAddonLogs extends LitElement {
|
||||||
this._error = undefined;
|
this._error = undefined;
|
||||||
try {
|
try {
|
||||||
this._content = await fetchHassioAddonLogs(this.hass, this.addon.slug);
|
this._content = await fetchHassioAddonLogs(this.hass, this.addon.slug);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.logs.get_logs",
|
"addon.logs.get_logs",
|
||||||
"error",
|
"error",
|
||||||
|
|
|
@ -294,7 +294,7 @@ export class HassioBackups extends LitElement {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
this._selectedBackups.map((slug) => removeBackup(this.hass, slug))
|
this._selectedBackups.map((slug) => removeBackup(this.hass, slug))
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("backup.failed_to_delete"),
|
title: this.supervisor.localize("backup.failed_to_delete"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
|
|
@ -37,7 +37,7 @@ class HassioCardContent extends LitElement {
|
||||||
${this.iconImage
|
${this.iconImage
|
||||||
? html`
|
? html`
|
||||||
<div class="icon_image ${this.iconClass}">
|
<div class="icon_image ${this.iconClass}">
|
||||||
<img src="${this.iconImage}" .title=${this.iconTitle} />
|
<img src=${this.iconImage} .title=${this.iconTitle} />
|
||||||
<div></div>
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
|
@ -70,7 +70,7 @@ export class HassioUploadBackup extends LitElement {
|
||||||
try {
|
try {
|
||||||
const backup = await uploadBackup(this.hass, file);
|
const backup = await uploadBackup(this.hass, file);
|
||||||
fireEvent(this, "backup-uploaded", { backup: backup.data });
|
fireEvent(this, "backup-uploaded", { backup: backup.data });
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: "Upload failed",
|
title: "Upload failed",
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
|
|
@ -20,10 +20,10 @@ class SupervisorMetric extends LitElement {
|
||||||
<div slot="description" .title=${this.tooltip ?? ""}>
|
<div slot="description" .title=${this.tooltip ?? ""}>
|
||||||
<span class="value"> ${roundedValue} % </span>
|
<span class="value"> ${roundedValue} % </span>
|
||||||
<ha-bar
|
<ha-bar
|
||||||
class="${classMap({
|
class=${classMap({
|
||||||
"target-warning": roundedValue > 50,
|
"target-warning": roundedValue > 50,
|
||||||
"target-critical": roundedValue > 85,
|
"target-critical": roundedValue > 85,
|
||||||
})}"
|
})}
|
||||||
.value=${this.value}
|
.value=${this.value}
|
||||||
></ha-bar>
|
></ha-bar>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -136,7 +136,7 @@ export class HassioUpdate extends LitElement {
|
||||||
</ha-settings-row>
|
</ha-settings-row>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
<a href="${releaseNotesUrl}" target="_blank" rel="noreferrer">
|
<a href=${releaseNotesUrl} target="_blank" rel="noreferrer">
|
||||||
<mwc-button>
|
<mwc-button>
|
||||||
${this.supervisor.localize("common.release_notes")}
|
${this.supervisor.localize("common.release_notes")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
|
@ -206,7 +206,7 @@ export class HassioUpdate extends LitElement {
|
||||||
fireEvent(this, "supervisor-collection-refresh", {
|
fireEvent(this, "supervisor-collection-refresh", {
|
||||||
collection: item.key,
|
collection: item.key,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Only show an error if the status code was not expected (user behind proxy)
|
// Only show an error if the status code was not expected (user behind proxy)
|
||||||
// or no status at all(connection terminated)
|
// or no status at all(connection terminated)
|
||||||
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
||||||
|
|
|
@ -311,7 +311,7 @@ class HassioBackupDialog
|
||||||
: "snapshots"
|
: "snapshots"
|
||||||
}/${this._backup!.slug}/download`
|
}/${this._backup!.slug}/download`
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
});
|
});
|
||||||
|
|
|
@ -127,7 +127,7 @@ class HassioCreateBackupDialog extends LitElement {
|
||||||
|
|
||||||
this._dialogParams!.onCreate();
|
this._dialogParams!.onCreate();
|
||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = extractApiErrorMessage(err);
|
this._error = extractApiErrorMessage(err);
|
||||||
}
|
}
|
||||||
this._creatingBackup = false;
|
this._creatingBackup = false;
|
||||||
|
|
|
@ -149,7 +149,7 @@ class HassioDatadiskDialog extends LitElement {
|
||||||
this.moving = true;
|
this.moving = true;
|
||||||
try {
|
try {
|
||||||
await moveDatadisk(this.hass, this.selectedDevice!);
|
await moveDatadisk(this.hass, this.selectedDevice!);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.dialogParams!.supervisor.localize(
|
title: this.dialogParams!.supervisor.localize(
|
||||||
|
|
|
@ -287,7 +287,7 @@ export class DialogHassioNetwork
|
||||||
this.hass,
|
this.hass,
|
||||||
this._interface.interface
|
this._interface.interface
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: "Failed to scan for accesspoints",
|
title: "Failed to scan for accesspoints",
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -448,7 +448,7 @@ export class DialogHassioNetwork
|
||||||
this._interface!.interface,
|
this._interface!.interface,
|
||||||
interfaceOptions
|
interfaceOptions
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("dialog.network.failed_to_change"),
|
title: this.supervisor.localize("dialog.network.failed_to_change"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
|
|
@ -190,7 +190,7 @@ class HassioRegistriesDialog extends LitElement {
|
||||||
await addHassioDockerRegistry(this.hass, data);
|
await addHassioDockerRegistry(this.hass, data);
|
||||||
await this._loadRegistries();
|
await this._loadRegistries();
|
||||||
this._addingRegistry = false;
|
this._addingRegistry = false;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("dialog.registries.failed_to_add"),
|
title: this.supervisor.localize("dialog.registries.failed_to_add"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -204,7 +204,7 @@ class HassioRegistriesDialog extends LitElement {
|
||||||
try {
|
try {
|
||||||
await removeHassioDockerRegistry(this.hass, entry.registry);
|
await removeHassioDockerRegistry(this.hass, entry.registry);
|
||||||
await this._loadRegistries();
|
await this._loadRegistries();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("dialog.registries.failed_to_remove"),
|
title: this.supervisor.localize("dialog.registries.failed_to_remove"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
|
|
@ -185,7 +185,7 @@ class HassioRepositoriesDialog extends LitElement {
|
||||||
this._repositories = addonsinfo.repositories;
|
this._repositories = addonsinfo.repositories;
|
||||||
|
|
||||||
fireEvent(this, "supervisor-collection-refresh", { collection: "addon" });
|
fireEvent(this, "supervisor-collection-refresh", { collection: "addon" });
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = extractApiErrorMessage(err);
|
this._error = extractApiErrorMessage(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ class HassioRepositoriesDialog extends LitElement {
|
||||||
await this._loadData();
|
await this._loadData();
|
||||||
|
|
||||||
input.value = "";
|
input.value = "";
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = extractApiErrorMessage(err);
|
this._error = extractApiErrorMessage(err);
|
||||||
}
|
}
|
||||||
this._processing = false;
|
this._processing = false;
|
||||||
|
@ -229,7 +229,7 @@ class HassioRepositoriesDialog extends LitElement {
|
||||||
addons_repositories: newRepositories,
|
addons_repositories: newRepositories,
|
||||||
});
|
});
|
||||||
await this._loadData();
|
await this._loadData();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = extractApiErrorMessage(err);
|
this._error = extractApiErrorMessage(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ export const suggestAddonRestart = async (
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
try {
|
try {
|
||||||
await restartHassioAddon(hass, addon.slug);
|
await restartHassioAddon(hass, addon.slug);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(element, {
|
showAlertDialog(element, {
|
||||||
title: supervisor.localize(
|
title: supervisor.localize(
|
||||||
"common.failed_to_restart_name",
|
"common.failed_to_restart_name",
|
||||||
|
|
|
@ -148,7 +148,7 @@ class DialogSupervisorUpdate extends LitElement {
|
||||||
this.hass,
|
this.hass,
|
||||||
this._dialogParams!.backupParams
|
this._dialogParams!.backupParams
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = extractApiErrorMessage(err);
|
this._error = extractApiErrorMessage(err);
|
||||||
this._action = null;
|
this._action = null;
|
||||||
return;
|
return;
|
||||||
|
@ -158,7 +158,7 @@ class DialogSupervisorUpdate extends LitElement {
|
||||||
this._action = "update";
|
this._action = "update";
|
||||||
try {
|
try {
|
||||||
await this._dialogParams!.updateHandler!();
|
await this._dialogParams!.updateHandler!();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
||||||
this._error = extractApiErrorMessage(err);
|
this._error = extractApiErrorMessage(err);
|
||||||
this._action = null;
|
this._action = null;
|
||||||
|
|
|
@ -87,7 +87,7 @@ class HassioMyRedirect extends LitElement {
|
||||||
let url: string;
|
let url: string;
|
||||||
try {
|
try {
|
||||||
url = this._createRedirectUrl(redirect);
|
url = this._createRedirectUrl(redirect);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize("my.error");
|
this._error = this.supervisor.localize("my.error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ class HassioIngressView extends LitElement {
|
||||||
if (requestedAddon) {
|
if (requestedAddon) {
|
||||||
try {
|
try {
|
||||||
addonInfo = await fetchHassioAddonInfo(this.hass, requestedAddon);
|
addonInfo = await fetchHassioAddonInfo(this.hass, requestedAddon);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
title: requestedAddon,
|
title: requestedAddon,
|
||||||
|
@ -145,7 +145,7 @@ class HassioIngressView extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
addon = await fetchHassioAddonInfo(this.hass, addonSlug);
|
addon = await fetchHassioAddonInfo(this.hass, addonSlug);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
text: "Unable to fetch add-on info to start Ingress",
|
text: "Unable to fetch add-on info to start Ingress",
|
||||||
title: "Supervisor",
|
title: "Supervisor",
|
||||||
|
@ -179,7 +179,7 @@ class HassioIngressView extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
session = await createSessionPromise;
|
session = await createSessionPromise;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
text: "Unable to create an Ingress session",
|
text: "Unable to create an Ingress session",
|
||||||
title: addon.name,
|
title: addon.name,
|
||||||
|
@ -195,7 +195,7 @@ class HassioIngressView extends LitElement {
|
||||||
this._sessionKeepAlive = window.setInterval(async () => {
|
this._sessionKeepAlive = window.setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
await validateHassioSession(this.hass, session);
|
await validateHassioSession(this.hass, session);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
session = await createHassioSession(this.hass);
|
session = await createHassioSession(this.hass);
|
||||||
}
|
}
|
||||||
}, 60000);
|
}, 60000);
|
||||||
|
|
|
@ -144,7 +144,7 @@ class HassioCoreInfo extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await restartCore(this.hass);
|
await restartCore(this.hass);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (this.hass.connection.connected) {
|
if (this.hass.connection.connected) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
|
|
|
@ -247,7 +247,7 @@ class HassioHostInfo extends LitElement {
|
||||||
let hardware;
|
let hardware;
|
||||||
try {
|
try {
|
||||||
hardware = await fetchHassioHardwareInfo(this.hass);
|
hardware = await fetchHassioHardwareInfo(this.hass);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"system.host.failed_to_get_hardware_list"
|
"system.host.failed_to_get_hardware_list"
|
||||||
|
@ -277,7 +277,7 @@ class HassioHostInfo extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await rebootHost(this.hass);
|
await rebootHost(this.hass);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Ignore connection errors, these are all expected
|
// Ignore connection errors, these are all expected
|
||||||
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
|
@ -307,7 +307,7 @@ class HassioHostInfo extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await shutdownHost(this.hass);
|
await shutdownHost(this.hass);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Ignore connection errors, these are all expected
|
// Ignore connection errors, these are all expected
|
||||||
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
if (this.hass.connection.connected && !ignoreSupervisorError(err)) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
|
@ -348,7 +348,7 @@ class HassioHostInfo extends LitElement {
|
||||||
try {
|
try {
|
||||||
await updateOS(this.hass);
|
await updateOS(this.hass);
|
||||||
fireEvent(this, "supervisor-collection-refresh", { collection: "os" });
|
fireEvent(this, "supervisor-collection-refresh", { collection: "os" });
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (this.hass.connection.connected) {
|
if (this.hass.connection.connected) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
|
@ -386,7 +386,7 @@ class HassioHostInfo extends LitElement {
|
||||||
fireEvent(this, "supervisor-collection-refresh", {
|
fireEvent(this, "supervisor-collection-refresh", {
|
||||||
collection: "host",
|
collection: "host",
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("system.host.failed_to_set_hostname"),
|
title: this.supervisor.localize("system.host.failed_to_set_hostname"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -401,7 +401,7 @@ class HassioHostInfo extends LitElement {
|
||||||
fireEvent(this, "supervisor-collection-refresh", {
|
fireEvent(this, "supervisor-collection-refresh", {
|
||||||
collection: "host",
|
collection: "host",
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"system.host.failed_to_import_from_usb"
|
"system.host.failed_to_import_from_usb"
|
||||||
|
|
|
@ -282,7 +282,7 @@ class HassioSupervisorInfo extends LitElement {
|
||||||
};
|
};
|
||||||
await setSupervisorOption(this.hass, data);
|
await setSupervisorOption(this.hass, data);
|
||||||
await this._reloadSupervisor();
|
await this._reloadSupervisor();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"system.supervisor.failed_to_set_option"
|
"system.supervisor.failed_to_set_option"
|
||||||
|
@ -300,7 +300,7 @@ class HassioSupervisorInfo extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this._reloadSupervisor();
|
await this._reloadSupervisor();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize("system.supervisor.failed_to_reload"),
|
title: this.supervisor.localize("system.supervisor.failed_to_reload"),
|
||||||
text: extractApiErrorMessage(err),
|
text: extractApiErrorMessage(err),
|
||||||
|
@ -343,7 +343,7 @@ class HassioSupervisorInfo extends LitElement {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await restartSupervisor(this.hass);
|
await restartSupervisor(this.hass);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"common.failed_to_restart_name",
|
"common.failed_to_restart_name",
|
||||||
|
@ -388,7 +388,7 @@ class HassioSupervisorInfo extends LitElement {
|
||||||
fireEvent(this, "supervisor-collection-refresh", {
|
fireEvent(this, "supervisor-collection-refresh", {
|
||||||
collection: "supervisor",
|
collection: "supervisor",
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"common.failed_to_update_name",
|
"common.failed_to_update_name",
|
||||||
|
@ -427,10 +427,10 @@ class HassioSupervisorInfo extends LitElement {
|
||||||
<li>
|
<li>
|
||||||
${UNSUPPORTED_REASON_URL[reason]
|
${UNSUPPORTED_REASON_URL[reason]
|
||||||
? html`<a
|
? html`<a
|
||||||
href="${documentationUrl(
|
href=${documentationUrl(
|
||||||
this.hass,
|
this.hass,
|
||||||
UNSUPPORTED_REASON_URL[reason]
|
UNSUPPORTED_REASON_URL[reason]
|
||||||
)}"
|
)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
|
@ -458,10 +458,10 @@ class HassioSupervisorInfo extends LitElement {
|
||||||
<li>
|
<li>
|
||||||
${UNHEALTHY_REASON_URL[reason]
|
${UNHEALTHY_REASON_URL[reason]
|
||||||
? html`<a
|
? html`<a
|
||||||
href="${documentationUrl(
|
href=${documentationUrl(
|
||||||
this.hass,
|
this.hass,
|
||||||
UNHEALTHY_REASON_URL[reason]
|
UNHEALTHY_REASON_URL[reason]
|
||||||
)}"
|
)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
|
@ -483,7 +483,7 @@ class HassioSupervisorInfo extends LitElement {
|
||||||
diagnostics: !this.supervisor.supervisor?.diagnostics,
|
diagnostics: !this.supervisor.supervisor?.diagnostics,
|
||||||
};
|
};
|
||||||
await setSupervisorOption(this.hass, data);
|
await setSupervisorOption(this.hass, data);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.supervisor.localize(
|
title: this.supervisor.localize(
|
||||||
"system.supervisor.failed_to_set_option"
|
"system.supervisor.failed_to_set_option"
|
||||||
|
|
|
@ -130,7 +130,7 @@ class HassioSupervisorLog extends LitElement {
|
||||||
this.hass,
|
this.hass,
|
||||||
this._selectedLogProvider
|
this._selectedLogProvider
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"system.log.get_logs",
|
"system.log.get_logs",
|
||||||
"provider",
|
"provider",
|
||||||
|
|
33
package.json
33
package.json
|
@ -145,18 +145,18 @@
|
||||||
"xss": "^1.0.9"
|
"xss": "^1.0.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.14.6",
|
"@babel/core": "^7.15.5",
|
||||||
"@babel/plugin-external-helpers": "^7.14.5",
|
"@babel/plugin-external-helpers": "^7.14.5",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
"@babel/plugin-proposal-class-properties": "^7.14.5",
|
||||||
"@babel/plugin-proposal-decorators": "^7.14.5",
|
"@babel/plugin-proposal-decorators": "^7.15.4",
|
||||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
|
"@babel/plugin-proposal-object-rest-spread": "^7.15.6",
|
||||||
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
|
"@babel/plugin-proposal-optional-chaining": "^7.14.5",
|
||||||
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
||||||
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
||||||
"@babel/plugin-syntax-top-level-await": "^7.14.5",
|
"@babel/plugin-syntax-top-level-await": "^7.14.5",
|
||||||
"@babel/preset-env": "^7.14.7",
|
"@babel/preset-env": "^7.15.6",
|
||||||
"@babel/preset-typescript": "^7.14.5",
|
"@babel/preset-typescript": "^7.15.0",
|
||||||
"@koa/cors": "^3.1.0",
|
"@koa/cors": "^3.1.0",
|
||||||
"@open-wc/dev-server-hmr": "^0.0.2",
|
"@open-wc/dev-server-hmr": "^0.0.2",
|
||||||
"@rollup/plugin-babel": "^5.2.1",
|
"@rollup/plugin-babel": "^5.2.1",
|
||||||
|
@ -173,23 +173,24 @@
|
||||||
"@types/mocha": "^8",
|
"@types/mocha": "^8",
|
||||||
"@types/sortablejs": "^1",
|
"@types/sortablejs": "^1",
|
||||||
"@types/webspeechapi": "^0.0.29",
|
"@types/webspeechapi": "^0.0.29",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.28.3",
|
"@typescript-eslint/eslint-plugin": "^4.32.0",
|
||||||
"@typescript-eslint/parser": "^4.28.3",
|
"@typescript-eslint/parser": "^4.32.0",
|
||||||
"@web/dev-server": "^0.0.24",
|
"@web/dev-server": "^0.0.24",
|
||||||
"@web/dev-server-rollup": "^0.2.11",
|
"@web/dev-server-rollup": "^0.2.11",
|
||||||
"babel-loader": "^8.2.2",
|
"babel-loader": "^8.2.2",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"del": "^4.0.0",
|
"del": "^4.0.0",
|
||||||
"eslint": "^7.30.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-config-airbnb-typescript": "^12.3.1",
|
"eslint-config-airbnb-base": "^14.2.1",
|
||||||
|
"eslint-config-airbnb-typescript": "^14.0.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-import-resolver-webpack": "^0.13.1",
|
"eslint-import-resolver-webpack": "^0.13.1",
|
||||||
"eslint-plugin-disable": "^2.0.1",
|
"eslint-plugin-disable": "^2.0.1",
|
||||||
"eslint-plugin-import": "^2.23.4",
|
"eslint-plugin-import": "^2.24.2",
|
||||||
"eslint-plugin-lit": "^1.5.1",
|
"eslint-plugin-lit": "^1.5.1",
|
||||||
"eslint-plugin-prettier": "^3.4.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-unused-imports": "^1.1.2",
|
"eslint-plugin-unused-imports": "^1.1.5",
|
||||||
"eslint-plugin-wc": "^1.3.0",
|
"eslint-plugin-wc": "^1.3.2",
|
||||||
"fancy-log": "^1.3.3",
|
"fancy-log": "^1.3.3",
|
||||||
"fs-extra": "^7.0.1",
|
"fs-extra": "^7.0.1",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
|
@ -201,7 +202,7 @@
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"husky": "^1.3.1",
|
"husky": "^1.3.1",
|
||||||
"instant-mocha": "^1.3.1",
|
"instant-mocha": "^1.3.1",
|
||||||
"lint-staged": "^11.0.1",
|
"lint-staged": "^11.1.2",
|
||||||
"lit-analyzer": "^1.2.1",
|
"lit-analyzer": "^1.2.1",
|
||||||
"lodash.template": "^4.5.0",
|
"lodash.template": "^4.5.0",
|
||||||
"magic-string": "^0.25.7",
|
"magic-string": "^0.25.7",
|
||||||
|
@ -210,7 +211,7 @@
|
||||||
"mocha": "^8.4.0",
|
"mocha": "^8.4.0",
|
||||||
"object-hash": "^2.0.3",
|
"object-hash": "^2.0.3",
|
||||||
"open": "^7.0.4",
|
"open": "^7.0.4",
|
||||||
"prettier": "^2.3.2",
|
"prettier": "^2.4.1",
|
||||||
"require-dir": "^1.2.0",
|
"require-dir": "^1.2.0",
|
||||||
"rollup": "^2.8.2",
|
"rollup": "^2.8.2",
|
||||||
"rollup-plugin-string": "^3.0.0",
|
"rollup-plugin-string": "^3.0.0",
|
||||||
|
@ -222,7 +223,7 @@
|
||||||
"systemjs": "^6.3.2",
|
"systemjs": "^6.3.2",
|
||||||
"terser-webpack-plugin": "^5.2.4",
|
"terser-webpack-plugin": "^5.2.4",
|
||||||
"ts-lit-plugin": "^1.2.1",
|
"ts-lit-plugin": "^1.2.1",
|
||||||
"typescript": "^4.3.5",
|
"typescript": "^4.4.3",
|
||||||
"vinyl-buffer": "^1.0.1",
|
"vinyl-buffer": "^1.0.1",
|
||||||
"vinyl-source-stream": "^2.0.0",
|
"vinyl-source-stream": "^2.0.0",
|
||||||
"webpack": "^5.55.1",
|
"webpack": "^5.55.1",
|
||||||
|
|
|
@ -194,7 +194,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
|
||||||
this._state = "error";
|
this._state = "error";
|
||||||
this._errorMessage = data.message;
|
this._errorMessage = data.message;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error("Error starting auth flow", err);
|
console.error("Error starting auth flow", err);
|
||||||
this._state = "error";
|
this._state = "error";
|
||||||
|
@ -317,7 +317,7 @@ class HaAuthFlow extends litLocalizeLiteMixin(LitElement) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this._updateStep(newStep);
|
await this._updateStep(newStep);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error("Error submitting step", err);
|
console.error("Error submitting step", err);
|
||||||
this._state = "error";
|
this._state = "error";
|
||||||
|
|
|
@ -76,20 +76,20 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
|
||||||
${loggingInWith}
|
${loggingInWith}
|
||||||
|
|
||||||
<ha-auth-flow
|
<ha-auth-flow
|
||||||
.resources="${this.resources}"
|
.resources=${this.resources}
|
||||||
.clientId="${this.clientId}"
|
.clientId=${this.clientId}
|
||||||
.redirectUri="${this.redirectUri}"
|
.redirectUri=${this.redirectUri}
|
||||||
.oauth2State="${this.oauth2State}"
|
.oauth2State=${this.oauth2State}
|
||||||
.authProvider="${this._authProvider}"
|
.authProvider=${this._authProvider}
|
||||||
></ha-auth-flow>
|
></ha-auth-flow>
|
||||||
|
|
||||||
${inactiveProviders.length > 0
|
${inactiveProviders.length > 0
|
||||||
? html`
|
? html`
|
||||||
<ha-pick-auth-provider
|
<ha-pick-auth-provider
|
||||||
.resources="${this.resources}"
|
.resources=${this.resources}
|
||||||
.clientId="${this.clientId}"
|
.clientId=${this.clientId}
|
||||||
.authProviders="${inactiveProviders}"
|
.authProviders=${inactiveProviders}
|
||||||
@pick-auth-provider="${this._handleAuthProviderPick}"
|
@pick-auth-provider=${this._handleAuthProviderPick}
|
||||||
></ha-pick-auth-provider>
|
></ha-pick-auth-provider>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
@ -158,7 +158,7 @@ class HaAuthorize extends litLocalizeLiteMixin(LitElement) {
|
||||||
|
|
||||||
this._authProviders = authProviders;
|
this._authProviders = authProviders;
|
||||||
this._authProvider = authProviders[0];
|
this._authProvider = authProviders[0];
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error("Error loading auth providers", err);
|
console.error("Error loading auth providers", err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable lit/prefer-static-styles */
|
||||||
import { html, LitElement, TemplateResult } from "lit";
|
import { html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import "@polymer/paper-item/paper-item";
|
import "@polymer/paper-item/paper-item";
|
||||||
import "@polymer/paper-item/paper-item-body";
|
import "@polymer/paper-item/paper-item-body";
|
||||||
import { html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { property } from "lit/decorators";
|
import { property } from "lit/decorators";
|
||||||
import { fireEvent } from "../common/dom/fire_event";
|
import { fireEvent } from "../common/dom/fire_event";
|
||||||
import "../components/ha-icon-next";
|
import "../components/ha-icon-next";
|
||||||
|
@ -18,14 +18,6 @@ class HaPickAuthProvider extends litLocalizeLiteMixin(LitElement) {
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
return html`
|
return html`
|
||||||
<style>
|
|
||||||
paper-item {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<p>${this.localize("ui.panel.page-authorize.pick_auth_provider")}:</p>
|
<p>${this.localize("ui.panel.page-authorize.pick_auth_provider")}:</p>
|
||||||
${this.authProviders.map(
|
${this.authProviders.map(
|
||||||
(provider) => html`
|
(provider) => html`
|
||||||
|
@ -41,5 +33,14 @@ class HaPickAuthProvider extends litLocalizeLiteMixin(LitElement) {
|
||||||
private _handlePick(ev) {
|
private _handlePick(ev) {
|
||||||
fireEvent(this, "pick-auth-provider", ev.currentTarget.auth_provider);
|
fireEvent(this, "pick-auth-provider", ev.currentTarget.auth_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static styles = css`
|
||||||
|
paper-item {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
customElements.define("ha-pick-auth-provider", HaPickAuthProvider);
|
customElements.define("ha-pick-auth-provider", HaPickAuthProvider);
|
||||||
|
|
|
@ -33,7 +33,7 @@ export function saveTokens(tokens: AuthData | null) {
|
||||||
if (tokenCache.writeEnabled) {
|
if (tokenCache.writeEnabled) {
|
||||||
try {
|
try {
|
||||||
storage.hassTokens = JSON.stringify(tokens);
|
storage.hassTokens = JSON.stringify(tokens);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// write failed, ignore it. Happens if storage is full or private mode.
|
// write failed, ignore it. Happens if storage is full or private mode.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ export function loadTokens() {
|
||||||
} else {
|
} else {
|
||||||
tokenCache.tokens = null;
|
tokenCache.tokens = null;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
tokenCache.tokens = null;
|
tokenCache.tokens = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ class Storage {
|
||||||
this._storage[storageKey] = value;
|
this._storage[storageKey] = value;
|
||||||
try {
|
try {
|
||||||
window.localStorage.setItem(storageKey, JSON.stringify(value));
|
window.localStorage.setItem(storageKey, JSON.stringify(value));
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Safari in private mode doesn't allow localstorage
|
// Safari in private mode doesn't allow localstorage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ const processTheme = (
|
||||||
const prefixedRgbKey = `--${rgbKey}`;
|
const prefixedRgbKey = `--${rgbKey}`;
|
||||||
styles[prefixedRgbKey] = rgbValue;
|
styles[prefixedRgbKey] = rgbValue;
|
||||||
keys[prefixedRgbKey] = "";
|
keys[prefixedRgbKey] = "";
|
||||||
} catch (e) {
|
} catch (err: any) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,4 +5,4 @@ export const mainWindow =
|
||||||
? window
|
? window
|
||||||
: parent.name === MAIN_WINDOW_NAME
|
: parent.name === MAIN_WINDOW_NAME
|
||||||
? parent
|
? parent
|
||||||
: top;
|
: top!;
|
||||||
|
|
|
@ -51,10 +51,10 @@ export const formatNumber = (
|
||||||
locale,
|
locale,
|
||||||
getDefaultFormatOptions(num, options)
|
getDefaultFormatOptions(num, options)
|
||||||
).format(Number(num));
|
).format(Number(num));
|
||||||
} catch (error) {
|
} catch (err: any) {
|
||||||
// Don't fail when using "TEST" language
|
// Don't fail when using "TEST" language
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(error);
|
console.error(err);
|
||||||
return new Intl.NumberFormat(
|
return new Intl.NumberFormat(
|
||||||
undefined,
|
undefined,
|
||||||
getDefaultFormatOptions(num, options)
|
getDefaultFormatOptions(num, options)
|
||||||
|
|
|
@ -108,7 +108,7 @@ export const computeLocalize = async (
|
||||||
language,
|
language,
|
||||||
formats
|
formats
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
return "Translation error: " + err.message;
|
return "Translation error: " + err.message;
|
||||||
}
|
}
|
||||||
cache._localizationCache[messageKey] = translatedMessage;
|
cache._localizationCache[messageKey] = translatedMessage;
|
||||||
|
@ -125,7 +125,7 @@ export const computeLocalize = async (
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return translatedMessage.format<string>(argObject) as string;
|
return translatedMessage.format<string>(argObject) as string;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
return "Translation " + err;
|
return "Translation " + err;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default function parseAspectRatio(input: string) {
|
||||||
return arr.length === 1
|
return arr.length === 1
|
||||||
? { w: parseOrThrow(arr[0]), h: 1 }
|
? { w: parseOrThrow(arr[0]), h: 1 }
|
||||||
: { w: parseOrThrow(arr[0]), h: parseOrThrow(arr[1]) };
|
: { w: parseOrThrow(arr[0]), h: parseOrThrow(arr[1]) };
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Ignore the error
|
// Ignore the error
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -50,7 +50,7 @@ class HaCallApiButton extends LitElement {
|
||||||
this._progressButton.actionSuccess();
|
this._progressButton.actionSuccess();
|
||||||
eventData.success = true;
|
eventData.success = true;
|
||||||
eventData.response = resp;
|
eventData.response = resp;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this.progress = false;
|
this.progress = false;
|
||||||
this._progressButton.actionError();
|
this._progressButton.actionError();
|
||||||
eventData.success = false;
|
eventData.success = false;
|
||||||
|
|
|
@ -50,6 +50,7 @@ interface AreaDevices {
|
||||||
devices: string[];
|
devices: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
const rowRenderer: ComboBoxLitRenderer<AreaDevices> = (item) => html`<style>
|
const rowRenderer: ComboBoxLitRenderer<AreaDevices> = (item) => html`<style>
|
||||||
paper-item {
|
paper-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -46,6 +46,7 @@ export type HaDevicePickerDeviceFilterFunc = (
|
||||||
device: DeviceRegistryEntry
|
device: DeviceRegistryEntry
|
||||||
) => boolean;
|
) => boolean;
|
||||||
|
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
const rowRenderer: ComboBoxLitRenderer<Device> = (item) => html`<style>
|
const rowRenderer: ComboBoxLitRenderer<Device> = (item) => html`<style>
|
||||||
paper-item {
|
paper-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -23,6 +23,7 @@ import "./state-badge";
|
||||||
|
|
||||||
export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean;
|
export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean;
|
||||||
|
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
const rowRenderer: ComboBoxLitRenderer<string> = (item) => html`<style>
|
const rowRenderer: ComboBoxLitRenderer<string> = (item) => html`<style>
|
||||||
paper-item {
|
paper-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -26,6 +26,7 @@ import "./state-badge";
|
||||||
|
|
||||||
export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean;
|
export type HaEntityPickerEntityFilterFunc = (entityId: HassEntity) => boolean;
|
||||||
|
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
const rowRenderer: ComboBoxLitRenderer<HassEntity> = (item) => html`<style>
|
const rowRenderer: ComboBoxLitRenderer<HassEntity> = (item) => html`<style>
|
||||||
paper-icon-item {
|
paper-icon-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -57,11 +57,11 @@ export class HaStateLabelBadge extends LitElement {
|
||||||
return html`
|
return html`
|
||||||
<ha-label-badge
|
<ha-label-badge
|
||||||
class="warning"
|
class="warning"
|
||||||
label="${this.hass!.localize("state_badge.default.error")}"
|
label=${this.hass!.localize("state_badge.default.error")}
|
||||||
icon="hass:alert"
|
icon="hass:alert"
|
||||||
description="${this.hass!.localize(
|
description=${this.hass!.localize(
|
||||||
"state_badge.default.entity_not_found"
|
"state_badge.default.entity_not_found"
|
||||||
)}"
|
)}
|
||||||
></ha-label-badge>
|
></ha-label-badge>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -70,27 +70,25 @@ export class HaStateLabelBadge extends LitElement {
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-label-badge
|
<ha-label-badge
|
||||||
class="${classMap({
|
class=${classMap({
|
||||||
[domain]: true,
|
[domain]: true,
|
||||||
"has-unit_of_measurement":
|
"has-unit_of_measurement":
|
||||||
"unit_of_measurement" in entityState.attributes,
|
"unit_of_measurement" in entityState.attributes,
|
||||||
})}"
|
})}
|
||||||
.value="${this._computeValue(domain, entityState)}"
|
.value=${this._computeValue(domain, entityState)}
|
||||||
.icon="${this.icon
|
.icon=${this.icon ? this.icon : this._computeIcon(domain, entityState)}
|
||||||
? this.icon
|
.image=${this.icon
|
||||||
: this._computeIcon(domain, entityState)}"
|
|
||||||
.image="${this.icon
|
|
||||||
? ""
|
? ""
|
||||||
: this.image
|
: this.image
|
||||||
? this.image
|
? this.image
|
||||||
: entityState.attributes.entity_picture_local ||
|
: entityState.attributes.entity_picture_local ||
|
||||||
entityState.attributes.entity_picture}"
|
entityState.attributes.entity_picture}
|
||||||
.label="${this._computeLabel(
|
.label=${this._computeLabel(
|
||||||
domain,
|
domain,
|
||||||
entityState,
|
entityState,
|
||||||
this._timerTimeRemaining
|
this._timerTimeRemaining
|
||||||
)}"
|
)}
|
||||||
.description="${this.name ? this.name : computeStateName(entityState)}"
|
.description=${this.name ? this.name : computeStateName(entityState)}
|
||||||
></ha-label-badge>
|
></ha-label-badge>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,7 @@ export class HaStatisticPicker extends LitElement {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
state?: HassEntity;
|
state?: HassEntity;
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
}> = (item) => html`<style>
|
}> = (item) => html`<style>
|
||||||
paper-icon-item {
|
paper-icon-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -110,7 +111,7 @@ export class HaStatisticPicker extends LitElement {
|
||||||
? html`<a
|
? html`<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
href="${documentationUrl(this.hass, "/more-info/statistics/")}"
|
href=${documentationUrl(this.hass, "/more-info/statistics/")}
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
"ui.components.statistic-picker.learn_more"
|
"ui.components.statistic-picker.learn_more"
|
||||||
)}</a
|
)}</a
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { PolymerChangedEvent } from "../polymer-types";
|
||||||
import { HomeAssistant } from "../types";
|
import { HomeAssistant } from "../types";
|
||||||
import { HaComboBox } from "./ha-combo-box";
|
import { HaComboBox } from "./ha-combo-box";
|
||||||
|
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (item) => html`<style>
|
const rowRenderer: ComboBoxLitRenderer<HassioAddonInfo> = (item) => html`<style>
|
||||||
paper-item {
|
paper-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -109,7 +110,7 @@ class HaAddonPicker extends LitElement {
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.componencts.addon-picker.error.fetch_addons.title"
|
"ui.componencts.addon-picker.error.fetch_addons.title"
|
||||||
|
|
|
@ -46,6 +46,7 @@ import "./ha-svg-icon";
|
||||||
|
|
||||||
const rowRenderer: ComboBoxLitRenderer<AreaRegistryEntry> = (
|
const rowRenderer: ComboBoxLitRenderer<AreaRegistryEntry> = (
|
||||||
item
|
item
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
) => html`<style>
|
) => html`<style>
|
||||||
paper-item {
|
paper-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
@ -435,7 +436,7 @@ export class HaAreaPicker extends SubscribeMixin(LitElement) {
|
||||||
});
|
});
|
||||||
this._areas = [...this._areas!, area];
|
this._areas = [...this._areas!, area];
|
||||||
this._setValue(area.area_id);
|
this._setValue(area.area_id);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
text: this.hass.localize(
|
text: this.hass.localize(
|
||||||
"ui.components.area-picker.add_dialog.failed_create_area"
|
"ui.components.area-picker.add_dialog.failed_create_area"
|
||||||
|
|
|
@ -117,7 +117,7 @@ class HaCameraStream extends LitElement {
|
||||||
);
|
);
|
||||||
|
|
||||||
this._url = url;
|
this._url = url;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Fails if we were unable to get a stream
|
// Fails if we were unable to get a stream
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { PolymerChangedEvent } from "../polymer-types";
|
||||||
import { HomeAssistant } from "../types";
|
import { HomeAssistant } from "../types";
|
||||||
import "./ha-svg-icon";
|
import "./ha-svg-icon";
|
||||||
|
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
const defaultRowRenderer: ComboBoxLitRenderer<string> = (item) => html`<style>
|
const defaultRowRenderer: ComboBoxLitRenderer<string> = (item) => html`<style>
|
||||||
paper-item {
|
paper-item {
|
||||||
margin: -5px -10px;
|
margin: -5px -10px;
|
||||||
|
|
|
@ -26,10 +26,10 @@ class HaLabelBadge extends LitElement {
|
||||||
<div class="badge-container">
|
<div class="badge-container">
|
||||||
<div class="label-badge" id="badge">
|
<div class="label-badge" id="badge">
|
||||||
<div
|
<div
|
||||||
class="${classMap({
|
class=${classMap({
|
||||||
value: true,
|
value: true,
|
||||||
big: Boolean(this.value && this.value.length > 4),
|
big: Boolean(this.value && this.value.length > 4),
|
||||||
})}"
|
})}
|
||||||
>
|
>
|
||||||
<slot>
|
<slot>
|
||||||
${this.icon && !this.value && !this.image
|
${this.icon && !this.value && !this.image
|
||||||
|
@ -43,10 +43,10 @@ class HaLabelBadge extends LitElement {
|
||||||
${this.label
|
${this.label
|
||||||
? html`
|
? html`
|
||||||
<div
|
<div
|
||||||
class="${classMap({
|
class=${classMap({
|
||||||
label: true,
|
label: true,
|
||||||
big: this.label.length > 5,
|
big: this.label.length > 5,
|
||||||
})}"
|
})}
|
||||||
>
|
>
|
||||||
<span>${this.label}</span>
|
<span>${this.label}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -38,9 +38,8 @@ class HaMarkdownElement extends ReactiveElement {
|
||||||
|
|
||||||
const walker = document.createTreeWalker(
|
const walker = document.createTreeWalker(
|
||||||
this,
|
this,
|
||||||
1 /* SHOW_ELEMENT */,
|
NodeFilter.SHOW_ELEMENT,
|
||||||
null,
|
null
|
||||||
false
|
|
||||||
);
|
);
|
||||||
|
|
||||||
while (walker.nextNode()) {
|
while (walker.nextNode()) {
|
||||||
|
|
|
@ -89,7 +89,7 @@ export class HaPictureUpload extends LitElement {
|
||||||
const media = await createImage(this.hass, file);
|
const media = await createImage(this.hass, file);
|
||||||
this.value = generateImageThumbnailUrl(media.id, this.size);
|
this.value = generateImageThumbnailUrl(media.id, this.size);
|
||||||
fireEvent(this, "change");
|
fireEvent(this, "change");
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
text: err.toString(),
|
text: err.toString(),
|
||||||
});
|
});
|
||||||
|
|
|
@ -162,7 +162,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
@click=${this._openMoreInfo}
|
@click=${this._openMoreInfo}
|
||||||
.entityId="${entityId}"
|
.entityId=${entityId}
|
||||||
class="link"
|
class="link"
|
||||||
>
|
>
|
||||||
${entity.attributes.friendly_name || entityId}
|
${entity.attributes.friendly_name || entityId}
|
||||||
|
@ -187,7 +187,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||||
<button
|
<button
|
||||||
class="link"
|
class="link"
|
||||||
@click=${this._openMoreInfo}
|
@click=${this._openMoreInfo}
|
||||||
.entityId="${groupId}"
|
.entityId=${groupId}
|
||||||
>
|
>
|
||||||
${group.attributes.friendly_name || group.entity_id}
|
${group.attributes.friendly_name || group.entity_id}
|
||||||
</button>
|
</button>
|
||||||
|
@ -212,7 +212,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||||
<button
|
<button
|
||||||
class="link"
|
class="link"
|
||||||
@click=${this._openMoreInfo}
|
@click=${this._openMoreInfo}
|
||||||
.entityId="${sceneId}"
|
.entityId=${sceneId}
|
||||||
>
|
>
|
||||||
${scene.attributes.friendly_name || scene.entity_id}
|
${scene.attributes.friendly_name || scene.entity_id}
|
||||||
</button>
|
</button>
|
||||||
|
@ -239,7 +239,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||||
<button
|
<button
|
||||||
class="link"
|
class="link"
|
||||||
@click=${this._openMoreInfo}
|
@click=${this._openMoreInfo}
|
||||||
.entityId="${automationId}"
|
.entityId=${automationId}
|
||||||
>
|
>
|
||||||
${automation.attributes.friendly_name ||
|
${automation.attributes.friendly_name ||
|
||||||
automation.entity_id}
|
automation.entity_id}
|
||||||
|
@ -267,7 +267,7 @@ export class HaRelatedItems extends SubscribeMixin(LitElement) {
|
||||||
<button
|
<button
|
||||||
class="link"
|
class="link"
|
||||||
@click=${this._openMoreInfo}
|
@click=${this._openMoreInfo}
|
||||||
.entityId="${scriptId}"
|
.entityId=${scriptId}
|
||||||
>
|
>
|
||||||
${script.attributes.friendly_name || script.entity_id}
|
${script.attributes.friendly_name || script.entity_id}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -197,10 +197,10 @@ export class HaServiceControl extends LitElement {
|
||||||
<p>${serviceData?.description}</p>
|
<p>${serviceData?.description}</p>
|
||||||
${this._manifest
|
${this._manifest
|
||||||
? html` <a
|
? html` <a
|
||||||
href="${this._manifest.documentation}"
|
href=${this._manifest.documentation}
|
||||||
title="${this.hass.localize(
|
title=${this.hass.localize(
|
||||||
"ui.components.service-control.integration_doc"
|
"ui.components.service-control.integration_doc"
|
||||||
)}"
|
)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>
|
>
|
||||||
|
@ -406,7 +406,7 @@ export class HaServiceControl extends LitElement {
|
||||||
this._manifest = undefined;
|
this._manifest = undefined;
|
||||||
try {
|
try {
|
||||||
this._manifest = await fetchIntegrationManifest(this.hass, integration);
|
this._manifest = await fetchIntegrationManifest(this.hass, integration);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Ignore if loading manifest fails. Probably bad JSON in manifest
|
// Ignore if loading manifest fails. Probably bad JSON in manifest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import "./ha-combo-box";
|
||||||
|
|
||||||
const rowRenderer: ComboBoxLitRenderer<{ service: string; name: string }> = (
|
const rowRenderer: ComboBoxLitRenderer<{ service: string; name: string }> = (
|
||||||
item
|
item
|
||||||
|
// eslint-disable-next-line lit/prefer-static-styles
|
||||||
) => html`<style>
|
) => html`<style>
|
||||||
paper-item {
|
paper-item {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -36,7 +36,7 @@ export class HaYamlEditor extends LitElement {
|
||||||
value && !isEmpty(value)
|
value && !isEmpty(value)
|
||||||
? dump(value, { schema: this.yamlSchema })
|
? dump(value, { schema: this.yamlSchema })
|
||||||
: "";
|
: "";
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(err, value);
|
console.error(err, value);
|
||||||
alert(`There was an error converting to YAML: ${err}`);
|
alert(`There was an error converting to YAML: ${err}`);
|
||||||
|
@ -73,7 +73,7 @@ export class HaYamlEditor extends LitElement {
|
||||||
if (this._yaml) {
|
if (this._yaml) {
|
||||||
try {
|
try {
|
||||||
parsed = load(this._yaml, { schema: this.yamlSchema });
|
parsed = load(this._yaml, { schema: this.yamlSchema });
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// Invalid YAML
|
// Invalid YAML
|
||||||
isValid = false;
|
isValid = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,10 +375,10 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||||
"ui.components.media-browser.learn_adding_local_media",
|
"ui.components.media-browser.learn_adding_local_media",
|
||||||
"documentation",
|
"documentation",
|
||||||
html`<a
|
html`<a
|
||||||
href="${documentationUrl(
|
href=${documentationUrl(
|
||||||
this.hass,
|
this.hass,
|
||||||
"/more-info/local-media/add-media"
|
"/more-info/local-media/add-media"
|
||||||
)}"
|
)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
|
@ -510,7 +510,7 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||||
item.media_content_id,
|
item.media_content_id,
|
||||||
item.media_content_type
|
item.media_content_type
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.components.media-browser.media_browsing_error"
|
"ui.components.media-browser.media_browsing_error"
|
||||||
|
@ -591,10 +591,10 @@ export class HaMediaPlayerBrowse extends LitElement {
|
||||||
"ui.components.media-browser.setup_local_help",
|
"ui.components.media-browser.setup_local_help",
|
||||||
"documentation",
|
"documentation",
|
||||||
html`<a
|
html`<a
|
||||||
href="${documentationUrl(
|
href=${documentationUrl(
|
||||||
this.hass,
|
this.hass,
|
||||||
"/more-info/local-media/setup-media"
|
"/more-info/local-media/setup-media"
|
||||||
)}"
|
)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
|
|
|
@ -88,7 +88,7 @@ export class HatGraphBranch extends LitElement {
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
<div id="branches">
|
<div id="branches">
|
||||||
<svg id="lines" width="${this._totalWidth}" height="${this._maxHeight}">
|
<svg id="lines" width=${this._totalWidth} height=${this._maxHeight}>
|
||||||
${this._branches.map((branch) => {
|
${this._branches.map((branch) => {
|
||||||
if (branch.end) return "";
|
if (branch.end) return "";
|
||||||
return svg`
|
return svg`
|
||||||
|
|
|
@ -453,7 +453,7 @@ export class HatScriptGraph extends LitElement {
|
||||||
</mwc-icon-button>
|
</mwc-icon-button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log("Error creating script graph:", err);
|
console.log("Error creating script graph:", err);
|
||||||
|
|
|
@ -239,7 +239,7 @@ class ActionRenderer {
|
||||||
let data;
|
let data;
|
||||||
try {
|
try {
|
||||||
data = getDataFromPath(this.trace.config, path);
|
data = getDataFromPath(this.trace.config, path);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._renderEntry(
|
this._renderEntry(
|
||||||
path,
|
path,
|
||||||
`Unable to extract path ${path}. Download trace and report as bug`
|
`Unable to extract path ${path}. Download trace and report as bug`
|
||||||
|
|
|
@ -136,7 +136,7 @@ export const getRecentWithCache = (
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
fetchedHistory = results[1];
|
fetchedHistory = results[1];
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
delete stateHistoryCache[cacheKey];
|
delete stateHistoryCache[cacheKey];
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ export const getOptimisticCollection = <StateType>(
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return await saveCollection(conn, data);
|
return await saveCollection(conn, data);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (store) {
|
if (store) {
|
||||||
store.setState(current as any, true);
|
store.setState(current as any, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ export const getLogbookDataCache = async (
|
||||||
DATA_CACHE[cacheKey] = {};
|
DATA_CACHE[cacheKey] = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DATA_CACHE[cacheKey][entityId]) {
|
if (entityId in DATA_CACHE[cacheKey]) {
|
||||||
return DATA_CACHE[cacheKey][entityId];
|
return DATA_CACHE[cacheKey][entityId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button
|
<mwc-button
|
||||||
slot="primaryAction"
|
slot="primaryAction"
|
||||||
@click="${this._updateEntry}"
|
@click=${this._updateEntry}
|
||||||
.disabled=${this._submitting}
|
.disabled=${this._submitting}
|
||||||
>
|
>
|
||||||
${this.hass.localize("ui.dialogs.config_entry_system_options.update")}
|
${this.hass.localize("ui.dialogs.config_entry_system_options.update")}
|
||||||
|
@ -171,7 +171,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
||||||
}
|
}
|
||||||
this._params!.entryUpdated(result.config_entry);
|
this._params!.entryUpdated(result.config_entry);
|
||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = err.message || "Unknown error";
|
this._error = err.message || "Unknown error";
|
||||||
} finally {
|
} finally {
|
||||||
this._submitting = false;
|
this._submitting = false;
|
||||||
|
|
|
@ -115,7 +115,7 @@ class DataEntryFlowDialog extends LitElement {
|
||||||
this.hass,
|
this.hass,
|
||||||
params.continueFlowId
|
params.continueFlowId
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._step = undefined;
|
this._step = undefined;
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
|
@ -370,7 +370,7 @@ class DataEntryFlowDialog extends LitElement {
|
||||||
let step: DataEntryFlowStep;
|
let step: DataEntryFlowStep;
|
||||||
try {
|
try {
|
||||||
step = await this._params!.flowConfig.createFlow(this.hass, handler);
|
step = await this._params!.flowConfig.createFlow(this.hass, handler);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._step = undefined;
|
this._step = undefined;
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
|
|
|
@ -26,7 +26,7 @@ class StepFlowAbort extends LitElement {
|
||||||
${this.flowConfig.renderAbortDescription(this.hass, this.step)}
|
${this.flowConfig.renderAbortDescription(this.hass, this.step)}
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<mwc-button @click="${this._flowDone}"
|
<mwc-button @click=${this._flowDone}
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
"ui.panel.config.integrations.config_flow.close"
|
"ui.panel.config.integrations.config_flow.close"
|
||||||
)}</mwc-button
|
)}</mwc-button
|
||||||
|
|
|
@ -65,7 +65,7 @@ class StepFlowCreateEntry extends LitElement {
|
||||||
`}
|
`}
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<mwc-button @click="${this._flowDone}"
|
<mwc-button @click=${this._flowDone}
|
||||||
>${localize(
|
>${localize(
|
||||||
"ui.panel.config.integrations.config_flow.finish"
|
"ui.panel.config.integrations.config_flow.finish"
|
||||||
)}</mwc-button
|
)}</mwc-button
|
||||||
|
@ -87,7 +87,7 @@ class StepFlowCreateEntry extends LitElement {
|
||||||
await updateDeviceRegistryEntry(this.hass, device, {
|
await updateDeviceRegistryEntry(this.hass, device, {
|
||||||
area_id: area,
|
area_id: area,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
text: this.hass.localize(
|
text: this.hass.localize(
|
||||||
"ui.panel.config.integrations.config_flow.error_saving_area",
|
"ui.panel.config.integrations.config_flow.error_saving_area",
|
||||||
|
|
|
@ -159,7 +159,7 @@ class StepFlowForm extends LitElement {
|
||||||
fireEvent(this, "flow-update", {
|
fireEvent(this, "flow-update", {
|
||||||
step,
|
step,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._errorMsg =
|
this._errorMsg =
|
||||||
(err && err.body && err.body.message) || "Unknown error occurred";
|
(err && err.body && err.body.message) || "Unknown error occurred";
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -118,12 +118,12 @@ class StepFlowPickHandler extends LitElement {
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.config.integrations.note_about_website_reference"
|
"ui.panel.config.integrations.note_about_website_reference"
|
||||||
)}<a
|
)}<a
|
||||||
href="${documentationUrl(
|
href=${documentationUrl(
|
||||||
this.hass,
|
this.hass,
|
||||||
`/integrations/${
|
`/integrations/${
|
||||||
this._filter ? `#search/${this._filter}` : ""
|
this._filter ? `#search/${this._filter}` : ""
|
||||||
}`
|
}`
|
||||||
)}"
|
)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
|
|
|
@ -84,7 +84,7 @@ export const showDialog = async (
|
||||||
{ dialog: dialogTag, dialogParams: dialogParams, open: true },
|
{ dialog: dialogTag, dialogParams: dialogParams, open: true },
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// dialogParams could not be cloned, probably contains callback
|
// dialogParams could not be cloned, probably contains callback
|
||||||
mainWindow.history.pushState(
|
mainWindow.history.pushState(
|
||||||
{ dialog: dialogTag, dialogParams: null, open: true },
|
{ dialog: dialogTag, dialogParams: null, open: true },
|
||||||
|
|
|
@ -106,7 +106,7 @@ class MoreInfoCamera extends LitElement {
|
||||||
preload_stream: checkbox.checked!,
|
preload_stream: checkbox.checked!,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert(err.message);
|
alert(err.message);
|
||||||
checkbox.checked = !checkbox.checked;
|
checkbox.checked = !checkbox.checked;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,21 +21,21 @@ class MoreInfoCounter extends LitElement {
|
||||||
return html`
|
return html`
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<mwc-button
|
<mwc-button
|
||||||
.action="${"increment"}"
|
.action=${"increment"}
|
||||||
@click=${this._handleActionClick}
|
@click=${this._handleActionClick}
|
||||||
.disabled=${disabled}
|
.disabled=${disabled}
|
||||||
>
|
>
|
||||||
${this.hass!.localize("ui.card.counter.actions.increment")}
|
${this.hass!.localize("ui.card.counter.actions.increment")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button
|
<mwc-button
|
||||||
.action="${"decrement"}"
|
.action=${"decrement"}
|
||||||
@click=${this._handleActionClick}
|
@click=${this._handleActionClick}
|
||||||
.disabled=${disabled}
|
.disabled=${disabled}
|
||||||
>
|
>
|
||||||
${this.hass!.localize("ui.card.counter.actions.decrement")}
|
${this.hass!.localize("ui.card.counter.actions.decrement")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button
|
<mwc-button
|
||||||
.action="${"reset"}"
|
.action=${"reset"}
|
||||||
@click=${this._handleActionClick}
|
@click=${this._handleActionClick}
|
||||||
.disabled=${disabled}
|
.disabled=${disabled}
|
||||||
>
|
>
|
||||||
|
|
|
@ -27,26 +27,17 @@ class MoreInfoTimer extends LitElement {
|
||||||
: ""}
|
: ""}
|
||||||
${this.stateObj.state === "active"
|
${this.stateObj.state === "active"
|
||||||
? html`
|
? html`
|
||||||
<mwc-button
|
<mwc-button .action=${"pause"} @click=${this._handleActionClick}>
|
||||||
.action=${"pause"}
|
|
||||||
@click="${this._handleActionClick}"
|
|
||||||
>
|
|
||||||
${this.hass!.localize("ui.card.timer.actions.pause")}
|
${this.hass!.localize("ui.card.timer.actions.pause")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
${this.stateObj.state === "active" || this.stateObj.state === "paused"
|
${this.stateObj.state === "active" || this.stateObj.state === "paused"
|
||||||
? html`
|
? html`
|
||||||
<mwc-button
|
<mwc-button .action=${"cancel"} @click=${this._handleActionClick}>
|
||||||
.action=${"cancel"}
|
|
||||||
@click="${this._handleActionClick}"
|
|
||||||
>
|
|
||||||
${this.hass!.localize("ui.card.timer.actions.cancel")}
|
${this.hass!.localize("ui.card.timer.actions.cancel")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button
|
<mwc-button .action=${"finish"} @click=${this._handleActionClick}>
|
||||||
.action=${"finish"}
|
|
||||||
@click="${this._handleActionClick}"
|
|
||||||
>
|
|
||||||
${this.hass!.localize("ui.card.timer.actions.finish")}
|
${this.hass!.localize("ui.card.timer.actions.finish")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
`
|
`
|
||||||
|
|
|
@ -175,7 +175,7 @@ class MoreInfoWeather extends LitElement {
|
||||||
${item.condition
|
${item.condition
|
||||||
? html`
|
? html`
|
||||||
<ha-svg-icon
|
<ha-svg-icon
|
||||||
.path="${weatherIcons[item.condition]}"
|
.path=${weatherIcons[item.condition]}
|
||||||
></ha-svg-icon>
|
></ha-svg-icon>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
|
|
@ -141,7 +141,7 @@ export class MoreInfoLogbook extends LitElement {
|
||||||
this.hass.user?.is_admin ? loadTraceContexts(this.hass) : {},
|
this.hass.user?.is_admin ? loadTraceContexts(this.hass) : {},
|
||||||
this._fetchUserPromise,
|
this._fetchUserPromise,
|
||||||
]);
|
]);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = err.message;
|
this._error = err.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ export class HuiConfiguratorNotificationItem extends LitElement {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mwc-button slot="actions" @click="${this._handleClick}"
|
<mwc-button slot="actions" @click=${this._handleClick}
|
||||||
>${computeStateDisplay(
|
>${computeStateDisplay(
|
||||||
this.hass.localize,
|
this.hass.localize,
|
||||||
this.notification,
|
this.notification,
|
||||||
|
|
|
@ -29,13 +29,13 @@ export class HuiNotificationItem extends LitElement {
|
||||||
? html`
|
? html`
|
||||||
<configurator-notification-item
|
<configurator-notification-item
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.notification="${this.notification}"
|
.notification=${this.notification}
|
||||||
></configurator-notification-item>
|
></configurator-notification-item>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<persistent-notification-item
|
<persistent-notification-item
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.notification="${this.notification}"
|
.notification=${this.notification}
|
||||||
></persistent-notification-item>
|
></persistent-notification-item>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,16 +24,13 @@ export class HuiPersistentNotificationItem extends LitElement {
|
||||||
<notification-item-template>
|
<notification-item-template>
|
||||||
<span slot="header"> ${this.notification.title} </span>
|
<span slot="header"> ${this.notification.title} </span>
|
||||||
|
|
||||||
<ha-markdown
|
<ha-markdown breaks content=${this.notification.message}></ha-markdown>
|
||||||
breaks
|
|
||||||
content="${this.notification.message}"
|
|
||||||
></ha-markdown>
|
|
||||||
|
|
||||||
<div class="time">
|
<div class="time">
|
||||||
<span>
|
<span>
|
||||||
<ha-relative-time
|
<ha-relative-time
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.datetime="${this.notification.created_at}"
|
.datetime=${this.notification.created_at}
|
||||||
></ha-relative-time>
|
></ha-relative-time>
|
||||||
<paper-tooltip animation-delay="0">
|
<paper-tooltip animation-delay="0">
|
||||||
${this._computeTooltip(this.hass, this.notification)}
|
${this._computeTooltip(this.hass, this.notification)}
|
||||||
|
@ -41,7 +38,7 @@ export class HuiPersistentNotificationItem extends LitElement {
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mwc-button slot="actions" @click="${this._handleDismiss}"
|
<mwc-button slot="actions" @click=${this._handleDismiss}
|
||||||
>${this.hass.localize(
|
>${this.hass.localize(
|
||||||
"ui.card.persistent_notification.dismiss"
|
"ui.card.persistent_notification.dismiss"
|
||||||
)}</mwc-button
|
)}</mwc-button
|
||||||
|
|
|
@ -271,7 +271,7 @@ export class QuickBar extends LitElement {
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<ha-chip
|
<ha-chip
|
||||||
.label="${item.categoryText}"
|
.label=${item.categoryText}
|
||||||
hasIcon
|
hasIcon
|
||||||
class="command-category ${item.categoryKey}"
|
class="command-category ${item.categoryKey}"
|
||||||
>
|
>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable lit/prefer-static-styles */
|
||||||
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
import type { PaperDialogScrollableElement } from "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
import type { PaperDialogScrollableElement } from "@polymer/paper-dialog-scrollable/paper-dialog-scrollable";
|
||||||
import "@polymer/paper-input/paper-input";
|
import "@polymer/paper-input/paper-input";
|
||||||
|
@ -114,7 +115,7 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||||
<div class="side-by-side" @click=${this._completeOnboarding}>
|
<div class="side-by-side" @click=${this._completeOnboarding}>
|
||||||
<a
|
<a
|
||||||
class="button"
|
class="button"
|
||||||
href="${this._agentInfo.onboarding.url}"
|
href=${this._agentInfo.onboarding.url}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
><mwc-button unelevated
|
><mwc-button unelevated
|
||||||
|
@ -138,7 +139,7 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||||
>
|
>
|
||||||
${this._conversation.map(
|
${this._conversation.map(
|
||||||
(message) => html`
|
(message) => html`
|
||||||
<div class="${this._computeMessageClasses(message)}">
|
<div class=${this._computeMessageClasses(message)}>
|
||||||
${message.text}
|
${message.text}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -159,11 +160,11 @@ export class HaVoiceCommandDialog extends LitElement {
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<paper-input
|
<paper-input
|
||||||
@keyup=${this._handleKeyUp}
|
@keyup=${this._handleKeyUp}
|
||||||
.label="${this.hass.localize(
|
.label=${this.hass.localize(
|
||||||
`ui.dialogs.voice_command.${
|
`ui.dialogs.voice_command.${
|
||||||
SpeechRecognition ? "label_voice" : "label"
|
SpeechRecognition ? "label_voice" : "label"
|
||||||
}`
|
}`
|
||||||
)}"
|
)}
|
||||||
autofocus
|
autofocus
|
||||||
>
|
>
|
||||||
${SpeechRecognition
|
${SpeechRecognition
|
||||||
|
|
|
@ -68,7 +68,7 @@ const connProm = async (auth) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return { auth, conn };
|
return { auth, conn };
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if (err !== ERR_INVALID_AUTH) {
|
if (err !== ERR_INVALID_AUTH) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ export class ExternalAuth extends Auth {
|
||||||
try {
|
try {
|
||||||
await this._tokenCallbackPromise;
|
await this._tokenCallbackPromise;
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch (err: any) {
|
||||||
// _tokenCallbackPromise is in a rejected state
|
// _tokenCallbackPromise is in a rejected state
|
||||||
// Clear the _tokenCallbackPromise and go on refreshing access token
|
// Clear the _tokenCallbackPromise and go on refreshing access token
|
||||||
this._tokenCallbackPromise = undefined;
|
this._tokenCallbackPromise = undefined;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-plugin-disable lit */
|
||||||
/**
|
/**
|
||||||
@license
|
@license
|
||||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||||
|
|
|
@ -169,7 +169,7 @@ export class HaTabsSubpageDataTable extends LitElement {
|
||||||
? html`<div class="active-filters">
|
? html`<div class="active-filters">
|
||||||
${this.narrow
|
${this.narrow
|
||||||
? html`<div>
|
? html`<div>
|
||||||
<ha-svg-icon .path="${mdiFilterVariant}"></ha-svg-icon>
|
<ha-svg-icon .path=${mdiFilterVariant}></ha-svg-icon>
|
||||||
<paper-tooltip animation-delay="0" position="left">
|
<paper-tooltip animation-delay="0" position="left">
|
||||||
${filterInfo}
|
${filterInfo}
|
||||||
</paper-tooltip>
|
</paper-tooltip>
|
||||||
|
|
|
@ -178,7 +178,7 @@ class HassTabsSubpage extends LitElement {
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
<div id="fab" class="${classMap({ tabs: showTabs })}">
|
<div id="fab" class=${classMap({ tabs: showTabs })}>
|
||||||
<slot name="fab"></slot>
|
<slot name="fab"></slot>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* eslint-disable lit/prefer-static-styles */
|
||||||
import "@polymer/app-layout/app-drawer-layout/app-drawer-layout";
|
import "@polymer/app-layout/app-drawer-layout/app-drawer-layout";
|
||||||
import type { AppDrawerLayoutElement } from "@polymer/app-layout/app-drawer-layout/app-drawer-layout";
|
import type { AppDrawerLayoutElement } from "@polymer/app-layout/app-drawer-layout/app-drawer-layout";
|
||||||
import "@polymer/app-layout/app-drawer/app-drawer";
|
import "@polymer/app-layout/app-drawer/app-drawer";
|
||||||
|
|
|
@ -145,10 +145,12 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
|
||||||
if (registration) {
|
if (registration) {
|
||||||
registration.update();
|
registration.update();
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-ignore Firefox supports forceGet
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// @ts-ignore Firefox supports forceGet
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +172,7 @@ export class HomeAssistantAppEl extends QuickBarMixin(HassElement) {
|
||||||
const { auth, conn } = result;
|
const { auth, conn } = result;
|
||||||
this._haVersion = conn.haVersion;
|
this._haVersion = conn.haVersion;
|
||||||
this.initializeHass(auth, conn);
|
this.initializeHass(auth, conn);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error = true;
|
this._error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
|
||||||
// Only load if we have supervisor
|
// Only load if we have supervisor
|
||||||
import("./onboarding-restore-backup");
|
import("./onboarding-restore-backup");
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(
|
console.error(
|
||||||
"Something went wrong loading onboarding-restore-backup",
|
"Something went wrong loading onboarding-restore-backup",
|
||||||
|
@ -220,7 +220,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
|
||||||
}
|
}
|
||||||
|
|
||||||
this._steps = steps;
|
this._steps = steps;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert("Something went wrong loading onboarding, try refreshing");
|
alert("Something went wrong loading onboarding, try refreshing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,7 +240,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
|
||||||
authCode: result.auth_code,
|
authCode: result.auth_code,
|
||||||
});
|
});
|
||||||
await this._connectHass(auth);
|
await this._connectHass(auth);
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert("Ah snap, something went wrong!");
|
alert("Ah snap, something went wrong!");
|
||||||
location.reload();
|
location.reload();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -275,7 +275,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
|
||||||
client_id: authParams.client_id!,
|
client_id: authParams.client_id!,
|
||||||
redirect_uri: authParams.redirect_uri!,
|
redirect_uri: authParams.redirect_uri!,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this.hass!.connection.close();
|
this.hass!.connection.close();
|
||||||
await this.hass!.auth.revoke();
|
await this.hass!.auth.revoke();
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ class OnboardingAnalytics extends LitElement {
|
||||||
fireEvent(this, "onboarding-step", {
|
fireEvent(this, "onboarding-step", {
|
||||||
type: "analytics",
|
type: "analytics",
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert(`Failed to save: ${err.message}`);
|
alert(`Failed to save: ${err.message}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,7 +307,7 @@ class OnboardingCoreConfig extends LitElement {
|
||||||
if (values.currency) {
|
if (values.currency) {
|
||||||
this._currency = values.currency;
|
this._currency = values.currency;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
alert(`Failed to detect location information: ${err.message}`);
|
alert(`Failed to detect location information: ${err.message}`);
|
||||||
} finally {
|
} finally {
|
||||||
this._working = false;
|
this._working = false;
|
||||||
|
@ -333,7 +333,7 @@ class OnboardingCoreConfig extends LitElement {
|
||||||
type: "core_config",
|
type: "core_config",
|
||||||
result,
|
result,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._working = false;
|
this._working = false;
|
||||||
alert(`Failed to save: ${err.message}`);
|
alert(`Failed to save: ${err.message}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,49 +58,49 @@ class OnboardingCreateUser extends LitElement {
|
||||||
<form>
|
<form>
|
||||||
<paper-input
|
<paper-input
|
||||||
name="name"
|
name="name"
|
||||||
label="${this.localize("ui.panel.page-onboarding.user.data.name")}"
|
label=${this.localize("ui.panel.page-onboarding.user.data.name")}
|
||||||
.value=${this._name}
|
.value=${this._name}
|
||||||
@value-changed=${this._handleValueChanged}
|
@value-changed=${this._handleValueChanged}
|
||||||
required
|
required
|
||||||
auto-validate
|
auto-validate
|
||||||
autocapitalize='on'
|
autocapitalize='on'
|
||||||
.errorMessage="${this.localize(
|
.errorMessage=${this.localize(
|
||||||
"ui.panel.page-onboarding.user.required_field"
|
"ui.panel.page-onboarding.user.required_field"
|
||||||
)}"
|
)}
|
||||||
@blur=${this._maybePopulateUsername}
|
@blur=${this._maybePopulateUsername}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
|
|
||||||
<paper-input
|
<paper-input
|
||||||
name="username"
|
name="username"
|
||||||
label="${this.localize("ui.panel.page-onboarding.user.data.username")}"
|
label=${this.localize("ui.panel.page-onboarding.user.data.username")}
|
||||||
value=${this._username}
|
value=${this._username}
|
||||||
@value-changed=${this._handleValueChanged}
|
@value-changed=${this._handleValueChanged}
|
||||||
required
|
required
|
||||||
auto-validate
|
auto-validate
|
||||||
autocapitalize='none'
|
autocapitalize='none'
|
||||||
.errorMessage="${this.localize(
|
.errorMessage=${this.localize(
|
||||||
"ui.panel.page-onboarding.user.required_field"
|
"ui.panel.page-onboarding.user.required_field"
|
||||||
)}"
|
)}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
|
|
||||||
<paper-input
|
<paper-input
|
||||||
name="password"
|
name="password"
|
||||||
label="${this.localize("ui.panel.page-onboarding.user.data.password")}"
|
label=${this.localize("ui.panel.page-onboarding.user.data.password")}
|
||||||
value=${this._password}
|
value=${this._password}
|
||||||
@value-changed=${this._handleValueChanged}
|
@value-changed=${this._handleValueChanged}
|
||||||
required
|
required
|
||||||
type='password'
|
type='password'
|
||||||
auto-validate
|
auto-validate
|
||||||
.errorMessage="${this.localize(
|
.errorMessage=${this.localize(
|
||||||
"ui.panel.page-onboarding.user.required_field"
|
"ui.panel.page-onboarding.user.required_field"
|
||||||
)}"
|
)}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
|
|
||||||
<paper-input
|
<paper-input
|
||||||
name="passwordConfirm"
|
name="passwordConfirm"
|
||||||
label="${this.localize(
|
label=${this.localize(
|
||||||
"ui.panel.page-onboarding.user.data.password_confirm"
|
"ui.panel.page-onboarding.user.data.password_confirm"
|
||||||
)}"
|
)}
|
||||||
value=${this._passwordConfirm}
|
value=${this._passwordConfirm}
|
||||||
@value-changed=${this._handleValueChanged}
|
@value-changed=${this._handleValueChanged}
|
||||||
required
|
required
|
||||||
|
@ -110,9 +110,9 @@ class OnboardingCreateUser extends LitElement {
|
||||||
this._passwordConfirm !== "" &&
|
this._passwordConfirm !== "" &&
|
||||||
this._passwordConfirm !== this._password
|
this._passwordConfirm !== this._password
|
||||||
}
|
}
|
||||||
.errorMessage="${this.localize(
|
.errorMessage=${this.localize(
|
||||||
"ui.panel.page-onboarding.user.error.password_not_match"
|
"ui.panel.page-onboarding.user.error.password_not_match"
|
||||||
)}"
|
)}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
|
|
||||||
<p class="action">
|
<p class="action">
|
||||||
|
@ -189,7 +189,7 @@ class OnboardingCreateUser extends LitElement {
|
||||||
type: "user",
|
type: "user",
|
||||||
result,
|
result,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.error(err);
|
console.error(err);
|
||||||
this._loading = false;
|
this._loading = false;
|
||||||
|
|
|
@ -62,7 +62,7 @@ class OnboardingRestoreBackup extends ProvideHassLitMixin(LitElement) {
|
||||||
if (this.restoring) {
|
if (this.restoring) {
|
||||||
try {
|
try {
|
||||||
await fetchInstallationType();
|
await fetchInstallationType();
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
if ((err as Error).message === "unauthorized") {
|
if ((err as Error).message === "unauthorized") {
|
||||||
window.location.replace("/");
|
window.location.replace("/");
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ class DialogAreaDetail extends LitElement {
|
||||||
<mwc-button
|
<mwc-button
|
||||||
slot="secondaryAction"
|
slot="secondaryAction"
|
||||||
class="warning"
|
class="warning"
|
||||||
@click="${this._deleteEntry}"
|
@click=${this._deleteEntry}
|
||||||
.disabled=${this._submitting}
|
.disabled=${this._submitting}
|
||||||
>
|
>
|
||||||
${this.hass.localize("ui.panel.config.areas.editor.delete")}
|
${this.hass.localize("ui.panel.config.areas.editor.delete")}
|
||||||
|
@ -92,7 +92,7 @@ class DialogAreaDetail extends LitElement {
|
||||||
: html``}
|
: html``}
|
||||||
<mwc-button
|
<mwc-button
|
||||||
slot="primaryAction"
|
slot="primaryAction"
|
||||||
@click="${this._updateEntry}"
|
@click=${this._updateEntry}
|
||||||
.disabled=${nameInvalid || this._submitting}
|
.disabled=${nameInvalid || this._submitting}
|
||||||
>
|
>
|
||||||
${entry
|
${entry
|
||||||
|
@ -130,7 +130,7 @@ class DialogAreaDetail extends LitElement {
|
||||||
await this._params!.createEntry!(values);
|
await this._params!.createEntry!(values);
|
||||||
}
|
}
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
this._error =
|
this._error =
|
||||||
err.message ||
|
err.message ||
|
||||||
this.hass.localize("ui.panel.config.areas.editor.unknown_error");
|
this.hass.localize("ui.panel.config.areas.editor.unknown_error");
|
||||||
|
|
|
@ -388,7 +388,7 @@ class HaConfigAreaPage extends LitElement {
|
||||||
try {
|
try {
|
||||||
await deleteAreaRegistryEntry(this.hass!, entry!.area_id);
|
await deleteAreaRegistryEntry(this.hass!, entry!.area_id);
|
||||||
return true;
|
return true;
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue