diff --git a/demo/src/ha-demo.ts b/demo/src/ha-demo.ts index 4cbc5ef266..b583245e5a 100644 --- a/demo/src/ha-demo.ts +++ b/demo/src/ha-demo.ts @@ -61,7 +61,7 @@ class HaDemo extends HomeAssistantAppEl { area_id: null, disabled_by: null, entity_id: "sensor.co2_intensity", - unique_id: "sensor.co2_intensity", + id: "sensor.co2_intensity", name: null, icon: null, platform: "co2signal", @@ -75,7 +75,7 @@ class HaDemo extends HomeAssistantAppEl { area_id: null, disabled_by: null, entity_id: "sensor.grid_fossil_fuel_percentage", - unique_id: "sensor.co2_intensity", + id: "sensor.co2_intensity", name: null, icon: null, platform: "co2signal", diff --git a/gallery/src/pages/components/dialogs.markdown b/gallery/src/pages/components/dialogs.markdown index 0558dc724f..69d6edf758 100644 --- a/gallery/src/pages/components/dialogs.markdown +++ b/gallery/src/pages/components/dialogs.markdown @@ -3,7 +3,7 @@ title: Dialgos subtitle: Dialogs provide important prompts in a user flow. --- -# Material Desing 3 +# Material Design 3 Our dialogs are based on the latest version of Material Design. Specs and guidelines can be found on it's [website](https://m3.material.io/components/dialogs/overview). diff --git a/gallery/src/pages/misc/integration-card.ts b/gallery/src/pages/misc/integration-card.ts index 88f436e2ae..7d3fc2eda4 100644 --- a/gallery/src/pages/misc/integration-card.ts +++ b/gallery/src/pages/misc/integration-card.ts @@ -191,7 +191,7 @@ const createEntityRegistryEntries = ( hidden_by: null, entity_category: null, entity_id: "binary_sensor.updater", - unique_id: "binary_sensor.updater", + id: "binary_sensor.updater", name: null, icon: null, platform: "updater", diff --git a/pyproject.toml b/pyproject.toml index a6643d62a0..9a413e0d22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20220831.0" +version = "20220901.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 5ee23206f7..19899e3033 100644 --- a/src/common/const.ts +++ b/src/common/const.ts @@ -126,6 +126,7 @@ export const FIXED_DEVICE_CLASS_ICONS = { gas: mdiGasCylinder, humidity: mdiWaterPercent, illuminance: mdiBrightness5, + moisture: mdiWaterPercent, monetary: mdiCash, nitrogen_dioxide: mdiMolecule, nitrogen_monoxide: mdiMolecule, diff --git a/src/data/entity_registry.ts b/src/data/entity_registry.ts index e02e801115..81a430dce4 100644 --- a/src/data/entity_registry.ts +++ b/src/data/entity_registry.ts @@ -7,8 +7,8 @@ import { debounce } from "../common/util/debounce"; import { HomeAssistant } from "../types"; export interface EntityRegistryEntry { + id: string; entity_id: string; - unique_id: string; name: string | null; icon: string | null; platform: string; @@ -23,6 +23,7 @@ export interface EntityRegistryEntry { } export interface ExtEntityRegistryEntry extends EntityRegistryEntry { + unique_id: string; capabilities: Record; original_icon?: string; device_class?: string; @@ -162,11 +163,11 @@ export const sortEntityRegistryByName = (entries: EntityRegistryEntry[]) => caseInsensitiveStringCompare(entry1.name || "", entry2.name || "") ); -export const entityRegistryByUniqueId = memoizeOne( +export const entityRegistryById = memoizeOne( (entries: HomeAssistant["entities"]) => { const entities: HomeAssistant["entities"] = {}; for (const entity of Object.values(entries)) { - entities[entity.unique_id] = entity; + entities[entity.id] = entity; } return entities; } diff --git a/src/data/script_i18n.ts b/src/data/script_i18n.ts index 7343249131..ffdb1b0b3b 100644 --- a/src/data/script_i18n.ts +++ b/src/data/script_i18n.ts @@ -10,7 +10,7 @@ import { localizeDeviceAutomationAction } from "./device_automation"; import { computeDeviceName } from "./device_registry"; import { computeEntityRegistryName, - entityRegistryByUniqueId, + entityRegistryById, } from "./entity_registry"; import { domainToName } from "./integration"; import { @@ -91,9 +91,7 @@ export const describeAction = ( targets.push(targetThing); } } else { - const entityReg = entityRegistryByUniqueId(hass.entities)[ - targetThing - ]; + const entityReg = entityRegistryById(hass.entities)[targetThing]; if (entityReg) { targets.push( computeEntityRegistryName(hass, entityReg) || targetThing diff --git a/src/panels/config/automation/action/ha-automation-action-row.ts b/src/panels/config/automation/action/ha-automation-action-row.ts index 565096f607..2df0a0f60d 100644 --- a/src/panels/config/automation/action/ha-automation-action-row.ts +++ b/src/panels/config/automation/action/ha-automation-action-row.ts @@ -157,13 +157,13 @@ export default class HaAutomationActionRow extends LitElement { ` : ""} -
+

${capitalizeFirstLetter(describeAction(this.hass, this.action))} -

+ ${this.index !== 0 ? html` @@ -507,6 +507,11 @@ export default class HaAutomationActionRow extends LitElement { --expansion-panel-summary-padding: 0 0 0 8px; --expansion-panel-content-padding: 0; } + h3 { + margin: 0; + font-size: inherit; + font-weight: inherit; + } .action-icon { display: none; } diff --git a/src/panels/config/automation/blueprint-automation-editor.ts b/src/panels/config/automation/blueprint-automation-editor.ts index 8446f2632e..5215c06dd1 100644 --- a/src/panels/config/automation/blueprint-automation-editor.ts +++ b/src/panels/config/automation/blueprint-automation-editor.ts @@ -3,7 +3,6 @@ import { HassEntity } from "home-assistant-js-websocket"; import { css, CSSResultGroup, html, LitElement, PropertyValues } from "lit"; import { customElement, property, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; -import "../../../components/entity/ha-entity-toggle"; import "../../../components/ha-blueprint-picker"; import "../../../components/ha-card"; import "../../../components/ha-circular-progress"; @@ -11,10 +10,7 @@ import "../../../components/ha-markdown"; import "../../../components/ha-selector/ha-selector"; import "../../../components/ha-settings-row"; import "../../../components/ha-textfield"; -import { - BlueprintAutomationConfig, - triggerAutomationActions, -} from "../../../data/automation"; +import { BlueprintAutomationConfig } from "../../../data/automation"; import { BlueprintOrError, Blueprints, @@ -67,9 +63,6 @@ export class HaBlueprintAutomationEditor extends LitElement { const blueprint = this._blueprint; return html` - ${!this.narrow - ? html` ${this.config.alias} ` - : ""} ${this.hass.localize( "ui.panel.config.automation.editor.introduction" @@ -102,36 +95,6 @@ export class HaBlueprintAutomationEditor extends LitElement { `} - ${this.stateObj - ? html` -
-
- - ${this.hass.localize( - "ui.panel.config.automation.editor.enable_disable" - )} -
-
- - - ${this.hass.localize( - "ui.panel.config.automation.editor.show_trace" - )} - - - - ${this.hass.localize("ui.card.automation.trigger")} - -
-
- ` - : ""}
@@ -220,10 +183,6 @@ export class HaBlueprintAutomationEditor extends LitElement { this._blueprints = await fetchBlueprints(this.hass, "automation"); } - private _runActions(ev: Event) { - triggerAutomationActions(this.hass, (ev.target as any).stateObj.entity_id); - } - private _blueprintChanged(ev) { ev.stopPropagation(); if (this.config.use_blueprint.path === ev.detail.value) { @@ -319,9 +278,6 @@ export class HaBlueprintAutomationEditor extends LitElement { p { margin-bottom: 0; } - ha-entity-toggle { - margin-right: 8px; - } ha-settings-row { --paper-time-input-justify-content: flex-end; --settings-row-content-width: 100%; diff --git a/src/panels/config/automation/condition/ha-automation-condition-row.ts b/src/panels/config/automation/condition/ha-automation-condition-row.ts index 4f201144ec..23f59cde9e 100644 --- a/src/panels/config/automation/condition/ha-automation-condition-row.ts +++ b/src/panels/config/automation/condition/ha-automation-condition-row.ts @@ -93,7 +93,7 @@ export default class HaAutomationConditionRow extends LitElement { : ""} -
+

+

-
+

${this.hass.localize( "ui.panel.config.automation.editor.automation_settings" )} -

+
-
+

${this.hass.localize( "ui.panel.config.automation.editor.triggers.header" )} -

+
-
+

${this.hass.localize( "ui.panel.config.automation.editor.conditions.header" )} -

+
-
+

${this.hass.localize( "ui.panel.config.automation.editor.actions.header" )} -

+
-
+

${capitalizeFirstLetter(describeTrigger(this.trigger, this.hass))} -

+ { const confirmed = await showConfirmationDialog(this, { - text: this.hass.localize("ui.panel.config.devices.confirm_delete"), + text: + this._integrations(device, this.entries).length > 1 + ? this.hass.localize( + `ui.panel.config.devices.confirm_delete_integration`, + { + integration: domainToName( + this.hass.localize, + entry.domain + ), + } + ) + : this.hass.localize(`ui.panel.config.devices.confirm_delete`), }); if (!confirmed) { @@ -960,7 +971,7 @@ export class HaConfigDevicePage extends LitElement { classes: "warning", icon: mdiDelete, label: - buttons.length > 1 + this._integrations(device, this.entries).length > 1 ? this.hass.localize( `ui.panel.config.devices.delete_device_integration`, { diff --git a/src/panels/config/entities/entity-registry-settings.ts b/src/panels/config/entities/entity-registry-settings.ts index 05f55a9d8a..da15534590 100644 --- a/src/panels/config/entities/entity-registry-settings.ts +++ b/src/panels/config/entities/entity-registry-settings.ts @@ -872,10 +872,17 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) { name: this._name.trim() || null, icon: this._icon.trim() || null, area_id: this._areaId || null, - device_class: this._deviceClass || null, new_entity_id: this._entityId.trim(), }; + // Only update device class if changed by user + if ( + this._deviceClass !== + (this.entry.device_class || this.entry.original_device_class) + ) { + params.device_class = this._deviceClass; + } + const stateObj: HassEntity | undefined = this.hass.states[this.entry.entity_id]; const domain = computeDomain(this.entry.entity_id); diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index beb10f83e8..ac02d2e048 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -68,10 +68,10 @@ import type { HomeAssistant, Route } from "../../../types"; import { configSections } from "../ha-panel-config"; import "../integrations/ha-integration-overflow-menu"; -export interface StateEntity extends Omit { +export interface StateEntity extends Omit { readonly?: boolean; selectable?: boolean; - unique_id?: string; + id?: string; } export interface EntityRow extends StateEntity { diff --git a/src/panels/config/helpers/forms/ha-schedule-form.ts b/src/panels/config/helpers/forms/ha-schedule-form.ts index c3a02975b6..a3387f9483 100644 --- a/src/panels/config/helpers/forms/ha-schedule-form.ts +++ b/src/panels/config/helpers/forms/ha-schedule-form.ts @@ -36,7 +36,6 @@ const defaultFullCalendarConfig: CalendarOptions = { selectOverlap: false, eventOverlap: false, allDaySlot: false, - slotMinTime: "00:00:59", height: "parent", locales: allLocales, firstDay: 1, @@ -178,7 +177,7 @@ class HaScheduleForm extends LitElement { }, eventTimeFormat: { hour: useAmPm(this.hass.locale) ? "numeric" : "2-digit", - minute: undefined, + minute: useAmPm(this.hass.locale) ? "numeric" : "2-digit", hour12: useAmPm(this.hass.locale), meridiem: useAmPm(this.hass.locale) ? "narrow" : false, }, @@ -214,7 +213,8 @@ class HaScheduleForm extends LitElement { } this[`_${day}`].forEach((item: ScheduleDay, index: number) => { - const distance = i - currentDay; + // Add 7 to 0 because we start the calendar on Monday + const distance = i - currentDay + (i === 0 ? 7 : 0); const start = new Date(); start.setDate(start.getDate() + distance); @@ -227,7 +227,9 @@ class HaScheduleForm extends LitElement { end.setDate(end.getDate() + distance); end.setHours( parseInt(item.to.slice(0, 2)), - parseInt(item.to.slice(-2)) + parseInt(item.to.slice(-2)), + 0, + 0 ); events.push({ diff --git a/src/panels/config/script/ha-script-editor.ts b/src/panels/config/script/ha-script-editor.ts index 1e47d76195..2fcd139bf8 100644 --- a/src/panels/config/script/ha-script-editor.ts +++ b/src/panels/config/script/ha-script-editor.ts @@ -331,11 +331,11 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) { ` : html`