- ${(this.value?.areas?.length || 0) +
- (this.value?.floors?.length || 0)}
-
`
+ ${(this.value?.areas?.length || 0) +
+ (this.value?.floors?.length || 0)}
+
+
${formatListWithAnds(
@@ -305,6 +312,16 @@ export class HaConfigAreasDashboard extends SubscribeMixin(LitElement) {
loadAreaRegistryDetailDialog();
}
+ private _openAreaDetails(ev) {
+ ev.preventDefault();
+ const area = ev.currentTarget.area;
+ showAreaRegistryDetailDialog(this, {
+ entry: area,
+ updateEntry: async (values) =>
+ updateAreaRegistryEntry(this.hass!, area.area_id, values),
+ });
+ }
+
private async _areaMoved(ev) {
const areasAndFloors = this._processAreas(
this.hass.areas,
@@ -469,8 +486,10 @@ export class HaConfigAreasDashboard extends SubscribeMixin(LitElement) {
min-height: 16px;
color: var(--secondary-text-color);
}
- .floor {
- --primary-color: var(--secondary-text-color);
+ .card-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
}
.warning {
color: var(--error-color);
diff --git a/src/panels/lovelace/common/generate-lovelace-config.ts b/src/panels/lovelace/common/generate-lovelace-config.ts
index 8af49cabdc..819001bb53 100644
--- a/src/panels/lovelace/common/generate-lovelace-config.ts
+++ b/src/panels/lovelace/common/generate-lovelace-config.ts
@@ -35,6 +35,7 @@ import { ButtonsHeaderFooterConfig } from "../header-footer/types";
const HIDE_DOMAIN = new Set([
"automation",
"configurator",
+ "conversation",
"device_tracker",
"geo_location",
"persistent_notification",
diff --git a/src/panels/lovelace/common/validate-condition.ts b/src/panels/lovelace/common/validate-condition.ts
index 00294ff9fe..908d5719dd 100644
--- a/src/panels/lovelace/common/validate-condition.ts
+++ b/src/panels/lovelace/common/validate-condition.ts
@@ -58,18 +58,12 @@ export interface AndCondition extends BaseCondition {
function getValueFromEntityId(
hass: HomeAssistant,
- value: string | string[]
-): string | string[] {
- if (
- typeof value === "string" &&
- isValidEntityId(value) &&
- hass.states[value]
- ) {
- value = hass.states[value]?.state;
- } else if (Array.isArray(value)) {
- value = value.map((v) => getValueFromEntityId(hass, v) as string);
+ value: string
+): string | undefined {
+ if (isValidEntityId(value) && hass.states[value]) {
+ return hass.states[value]?.state;
}
- return value;
+ return undefined;
}
function checkStateCondition(
@@ -83,8 +77,17 @@ function checkStateCondition(
let value = condition.state ?? condition.state_not;
// Handle entity_id, UI should be updated for conditionnal card (filters does not have UI for now)
- if (Array.isArray(value) || typeof value === "string") {
- value = getValueFromEntityId(hass, value);
+ if (Array.isArray(value)) {
+ const entityValues = value
+ .map((v) => getValueFromEntityId(hass, v))
+ .filter((v): v is string => v !== undefined);
+ value = [...value, ...entityValues];
+ } else if (typeof value === "string") {
+ const entityValue = getValueFromEntityId(hass, value);
+ value = [value];
+ if (entityValue) {
+ value.push(entityValue);
+ }
}
return condition.state != null
@@ -103,10 +106,10 @@ function checkStateNumericCondition(
// Handle entity_id, UI should be updated for conditionnal card (filters does not have UI for now)
if (typeof above === "string") {
- above = getValueFromEntityId(hass, above) as string;
+ above = getValueFromEntityId(hass, above) ?? above;
}
if (typeof below === "string") {
- below = getValueFromEntityId(hass, below) as string;
+ below = getValueFromEntityId(hass, below) ?? below;
}
const numericState = Number(state);
diff --git a/src/panels/lovelace/editor/dashboard-strategy-editor/dialogs/dialog-dashboard-strategy-editor.ts b/src/panels/lovelace/editor/dashboard-strategy-editor/dialogs/dialog-dashboard-strategy-editor.ts
index 0a826b11b0..f2b2320283 100644
--- a/src/panels/lovelace/editor/dashboard-strategy-editor/dialogs/dialog-dashboard-strategy-editor.ts
+++ b/src/panels/lovelace/editor/dashboard-strategy-editor/dialogs/dialog-dashboard-strategy-editor.ts
@@ -172,12 +172,14 @@ class DialogDashboardStrategyEditor extends LitElement {
`;
}
- private _takeControl() {
+ private _takeControl(ev) {
+ ev.stopPropagation();
this._params!.takeControl();
this.closeDialog();
}
- private _showRawConfigEditor() {
+ private _showRawConfigEditor(ev) {
+ ev.stopPropagation();
this._params!.showRawConfigEditor();
this.closeDialog();
}
diff --git a/src/panels/my/ha-panel-my.ts b/src/panels/my/ha-panel-my.ts
index 100eeddf59..e5a5e2c327 100644
--- a/src/panels/my/ha-panel-my.ts
+++ b/src/panels/my/ha-panel-my.ts
@@ -116,6 +116,9 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
entities: {
redirect: "/config/entities",
},
+ labels: {
+ redirect: "/config/labels",
+ },
energy: {
component: "energy",
redirect: "/energy",
diff --git a/src/translations/en.json b/src/translations/en.json
index 2f0ed5d46c..f41492dce9 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -1962,6 +1962,7 @@
"color": "Color"
},
"add_label": "Add label",
+ "manage_labels": "Manage labels",
"no_labels": "You don't have any labels",
"introduction": "Labels can help you organize your areas, devices and entities. They can be used to filter in the UI, or use them as a target in automations.",
"introduction2": "Go to the area, device or entity you want to add a label to, and click on the edit button to assign labels to them.",