diff --git a/hassio/src/backups/hassio-backups.ts b/hassio/src/backups/hassio-backups.ts index f2b0466623..abd17be598 100644 --- a/hassio/src/backups/hassio-backups.ts +++ b/hassio/src/backups/hassio-backups.ts @@ -119,6 +119,7 @@ export class HassioBackups extends LitElement { (narrow: boolean): DataTableColumnContainer => ({ name: { title: this.supervisor.localize("backup.name"), + main: true, sortable: true, filterable: true, grows: true, diff --git a/pyproject.toml b/pyproject.toml index 49715f19bc..bd5d34eab8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20221002.0" +version = "20221003.0" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md" diff --git a/src/common/const.ts b/src/common/const.ts index e4e383e49b..12db9d8d2c 100644 --- a/src/common/const.ts +++ b/src/common/const.ts @@ -43,6 +43,7 @@ import { mdiMoleculeCo, mdiMoleculeCo2, mdiPalette, + mdiProgressClock, mdiRayVertex, mdiRemote, mdiRobot, @@ -125,6 +126,7 @@ export const FIXED_DEVICE_CLASS_ICONS = { current: mdiCurrentAc, date: mdiCalendar, distance: mdiArrowLeftRight, + duration: mdiProgressClock, energy: mdiLightningBolt, frequency: mdiSineWave, gas: mdiMeterGas, diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index a9fa5ba391..8f18a0b77c 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -69,6 +69,7 @@ export interface DataTableSortColumnData { } export interface DataTableColumnData extends DataTableSortColumnData { + main?: boolean; title: TemplateResult | string; label?: TemplateResult | string; type?: "numeric" | "icon" | "icon-button" | "overflow-menu"; @@ -406,7 +407,7 @@ export class HaDataTable extends LitElement { } return html`
` : html``; } @@ -105,6 +112,7 @@ class HaCameraStream extends LitElement { .controls=${this.controls} .hass=${this.hass} .entityid=${this.stateObj.entity_id} + .posterUrl=${this._posterUrl} >`; } return html``; @@ -129,6 +137,20 @@ class HaCameraStream extends LitElement { return !isComponentLoaded(this.hass!, "stream"); } + private async _getPosterUrl(): Promise { + try { + this._posterUrl = await fetchThumbnailUrlWithCache( + this.hass!, + this.stateObj!.entity_id, + this.clientWidth, + this.clientHeight + ); + } catch (err: any) { + // poster url is optional + this._posterUrl = undefined; + } + } + private async _getStreamUrl(): Promise { try { const { url } = await fetchStreamUrl( diff --git a/src/components/ha-combo-box.ts b/src/components/ha-combo-box.ts index adbb06a1bd..fa328e4dda 100644 --- a/src/components/ha-combo-box.ts +++ b/src/components/ha-combo-box.ts @@ -297,7 +297,7 @@ export class HaComboBox extends LitElement { const newValue = ev.detail.value; if (newValue !== this.value) { - fireEvent(this, "value-changed", { value: newValue }); + fireEvent(this, "value-changed", { value: newValue || undefined }); } } diff --git a/src/components/ha-form/ha-form-float.ts b/src/components/ha-form/ha-form-float.ts index ce28ee7cae..5f0ea6d17a 100644 --- a/src/components/ha-form/ha-form-float.ts +++ b/src/components/ha-form/ha-form-float.ts @@ -26,6 +26,7 @@ export class HaFormFloat extends LitElement implements HaFormElement { protected render(): TemplateResult { return html` `; } diff --git a/src/data/recorder.ts b/src/data/recorder.ts index 5d6fd71806..caa97fd29a 100644 --- a/src/data/recorder.ts +++ b/src/data/recorder.ts @@ -289,3 +289,6 @@ export const getDisplayUnit = ( ? statisticsMetaData?.statistics_unit_of_measurement : unit; }; + +export const isExternalStatistic = (statisticsId: string): boolean => + statisticsId.includes(":"); diff --git a/src/panels/config/areas/ha-config-area-page.ts b/src/panels/config/areas/ha-config-area-page.ts index c211dccd9b..00c0f99a4d 100644 --- a/src/panels/config/areas/ha-config-area-page.ts +++ b/src/panels/config/areas/ha-config-area-page.ts @@ -610,13 +610,15 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) { if ( !(await showConfirmationDialog(this, { title: this.hass.localize( - "ui.panel.config.areas.delete.confirmation_title" + "ui.panel.config.areas.delete.confirmation_title", + { name: entry!.name } ), text: this.hass.localize( "ui.panel.config.areas.delete.confirmation_text" ), dismissText: this.hass.localize("ui.common.cancel"), confirmText: this.hass.localize("ui.common.delete"), + destructive: true, })) ) { return false; diff --git a/src/panels/config/automation/ha-automation-picker.ts b/src/panels/config/automation/ha-automation-picker.ts index fbe82913e9..66cb64e64a 100644 --- a/src/panels/config/automation/ha-automation-picker.ts +++ b/src/panels/config/automation/ha-automation-picker.ts @@ -100,6 +100,7 @@ class HaAutomationPicker extends LitElement { title: this.hass.localize( "ui.panel.config.automation.picker.headers.name" ), + main: true, sortable: true, filterable: true, direction: "asc", diff --git a/src/panels/config/automation/manual-automation-editor.ts b/src/panels/config/automation/manual-automation-editor.ts index 0ef9d6b166..59fc55b3ce 100644 --- a/src/panels/config/automation/manual-automation-editor.ts +++ b/src/panels/config/automation/manual-automation-editor.ts @@ -81,7 +81,11 @@ export class HaManualAutomationEditor extends LitElement { ` : ""} ${this.config.description - ? html`

${this.config.description}

` + ? html`` : ""}

diff --git a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts index d20053d184..9ac8ad7f9d 100644 --- a/src/panels/config/automation/trigger/ha-automation-trigger-row.ts +++ b/src/panels/config/automation/trigger/ha-automation-trigger-row.ts @@ -291,6 +291,7 @@ export default class HaAutomationTriggerRow extends LitElement { "ui.panel.config.automation.editor.triggers.id" )} .value=${this.trigger.id || ""} + .disabled=${this.disabled} @change=${this._idChanged} > diff --git a/src/panels/config/backup/ha-config-backup.ts b/src/panels/config/backup/ha-config-backup.ts index bb4d1104af..869e6e59a9 100644 --- a/src/panels/config/backup/ha-config-backup.ts +++ b/src/panels/config/backup/ha-config-backup.ts @@ -51,6 +51,7 @@ class HaConfigBackup extends LitElement { (narrow, _language): DataTableColumnContainer => ({ name: { title: this.hass.localize("ui.panel.config.backup.name"), + main: true, sortable: true, filterable: true, grows: true, diff --git a/src/panels/config/blueprint/ha-blueprint-overview.ts b/src/panels/config/blueprint/ha-blueprint-overview.ts index 3a395312af..0ed6081d61 100644 --- a/src/panels/config/blueprint/ha-blueprint-overview.ts +++ b/src/panels/config/blueprint/ha-blueprint-overview.ts @@ -109,6 +109,7 @@ class HaBlueprintOverview extends LitElement { title: this.hass.localize( "ui.panel.config.blueprint.overview.headers.name" ), + main: true, sortable: true, filterable: true, direction: "asc", diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 078ec02f79..ccfc4b201b 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -241,6 +241,7 @@ export class HaConfigDeviceDashboard extends LitElement { title: this.hass.localize( "ui.panel.config.devices.data_table.device" ), + main: true, sortable: true, filterable: true, direction: "asc", @@ -258,6 +259,7 @@ export class HaConfigDeviceDashboard extends LitElement { title: this.hass.localize( "ui.panel.config.devices.data_table.device" ), + main: true, sortable: true, filterable: true, grows: true, diff --git a/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts b/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts index 21dfda4df6..c0e37a46be 100644 --- a/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts +++ b/src/panels/config/energy/dialogs/dialog-energy-gas-settings.ts @@ -21,6 +21,7 @@ import type { HaRadio } from "../../../../components/ha-radio"; import { getStatisticMetadata, getDisplayUnit, + isExternalStatistic, } from "../../../../data/recorder"; @customElement("dialog-energy-gas-settings") @@ -86,7 +87,7 @@ export class DialogEnergyGasSettings : "ft³ or m³"); const externalSource = - this._source.stat_cost && this._source.stat_cost.includes(":"); + this._source.stat_cost && isExternalStatistic(this._source.stat_cost); return html` domain !== "homekit_controller"); diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index 55af2f7899..afa5d71126 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -78,6 +78,7 @@ export class HaConfigLovelaceDashboards extends LitElement { title: this.hass.localize( "ui.panel.config.lovelace.dashboards.picker.headers.title" ), + main: true, sortable: true, filterable: true, grows: true, diff --git a/src/panels/config/repairs/dialog-repairs-issue.ts b/src/panels/config/repairs/dialog-repairs-issue.ts index f974641a96..a7750d6d23 100644 --- a/src/panels/config/repairs/dialog-repairs-issue.ts +++ b/src/panels/config/repairs/dialog-repairs-issue.ts @@ -1,6 +1,7 @@ import "@material/mwc-button/mwc-button"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property, state } from "lit/decorators"; +import { formatDateNumeric } from "../../../common/datetime/format_date"; import { fireEvent } from "../../../common/dom/fire_event"; import { createCloseHeading } from "../../../components/ha-dialog"; import "../../../components/ha-markdown"; @@ -92,8 +93,9 @@ class DialogRepairsIssue extends LitElement { - ${this._issue.created - ? new Date(this._issue.created).toLocaleDateString( - this.hass.language + ? formatDateNumeric( + new Date(this._issue.created), + this.hass.locale ) : ""}

diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index afebd61588..76e857a7f3 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -95,6 +95,7 @@ class HaSceneDashboard extends LitElement { title: this.hass.localize( "ui.panel.config.scene.picker.headers.name" ), + main: true, sortable: true, filterable: true, direction: "asc", diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index a4f4891ae3..97ef655d18 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -93,6 +93,7 @@ class HaScriptPicker extends LitElement { }, name: { title: this.hass.localize("ui.panel.config.script.picker.headers.name"), + main: true, sortable: true, filterable: true, direction: "asc", diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index 87a4b01b18..e566aff75d 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -66,6 +66,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) { }, display_name: { title: this.hass.localize("ui.panel.config.tag.headers.name"), + main: true, sortable: true, filterable: true, grows: true, diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index b192716e43..54c949f7d7 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -43,6 +43,7 @@ export class HaConfigUsers extends LitElement { const columns: DataTableColumnContainer = { name: { title: localize("ui.panel.config.users.picker.headers.name"), + main: true, sortable: true, filterable: true, width: "25%", diff --git a/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts index e894f09411..f068a96c43 100644 --- a/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts @@ -32,6 +32,7 @@ import { baseLovelaceCardConfig } from "../structs/base-card-struct"; import { entitiesConfigStruct } from "../structs/entities-struct"; import { getStatisticMetadata, + isExternalStatistic, StatisticsMetaData, statisticsMetaHasType, } from "../../../../data/recorder"; @@ -132,9 +133,8 @@ export class HuiStatisticsGraphCardEditor disabled: period === "5minute" && // External statistics don't support 5-minute statistics. - // External statistics is formatted as : statisticIds?.some((statistic_id) => - statistic_id.includes(":") + isExternalStatistic(statistic_id) ), })), }, @@ -240,7 +240,9 @@ export class HuiStatisticsGraphCardEditor private async _entitiesChanged(ev: CustomEvent): Promise { const config = { ...this._config!, entities: ev.detail.value }; if ( - config.entities?.some((statistic_id) => statistic_id.includes(":")) && + config.entities?.some((statistic_id) => + isExternalStatistic(statistic_id) + ) && config.period === "5minute" ) { delete config.period; diff --git a/src/translations/en.json b/src/translations/en.json index 84c1a70332..4bc1820a41 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1313,8 +1313,8 @@ "no_linked_entities": "There are no entities linked to this area." }, "delete": { - "confirmation_title": "Are you sure you want to delete this area?", - "confirmation_text": "This user will be permanently deleted." + "confirmation_title": "Delete {name}?", + "confirmation_text": "This area will be permanently deleted and all devices belonging to this area will become unassigned." } }, "backup": {