From 6180ba0156ee375f6c8daba653065b4318a696aa Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 15 Dec 2025 15:18:29 +0100 Subject: [PATCH] Move other devices out of summaries --- .../lovelace/cards/hui-home-summary-card.ts | 1 - .../strategies/home/helpers/home-summaries.ts | 33 ------------------- .../home/helpers/other-devices-filters.ts | 33 +++++++++++++++++++ .../home/home-dashboard-strategy.ts | 4 +-- .../home/home-other-devices-view-strategy.ts | 6 ++-- .../home/home-overview-view-strategy.ts | 5 +-- 6 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 src/panels/lovelace/strategies/home/helpers/other-devices-filters.ts diff --git a/src/panels/lovelace/cards/hui-home-summary-card.ts b/src/panels/lovelace/cards/hui-home-summary-card.ts index 90f580a36a..e7981dccbb 100644 --- a/src/panels/lovelace/cards/hui-home-summary-card.ts +++ b/src/panels/lovelace/cards/hui-home-summary-card.ts @@ -35,7 +35,6 @@ const COLORS: Record = { climate: "deep-orange", security: "blue-grey", media_players: "blue", - other_devices: "grey", }; @customElement("hui-home-summary-card") diff --git a/src/panels/lovelace/strategies/home/helpers/home-summaries.ts b/src/panels/lovelace/strategies/home/helpers/home-summaries.ts index ea56a8ff6c..5f3c9557a1 100644 --- a/src/panels/lovelace/strategies/home/helpers/home-summaries.ts +++ b/src/panels/lovelace/strategies/home/helpers/home-summaries.ts @@ -1,4 +1,3 @@ -import { ASSIST_ENTITIES } from "../../../../../common/const"; import type { EntityFilter } from "../../../../../common/entity/entity_filter"; import type { LocalizeFunc } from "../../../../../common/translations/localize"; import { climateEntityFilters } from "../../../../climate/strategies/climate-view-strategy"; @@ -10,7 +9,6 @@ export const HOME_SUMMARIES = [ "climate", "security", "media_players", - "other_devices", ] as const; export type HomeSummary = (typeof HOME_SUMMARIES)[number]; @@ -20,7 +18,6 @@ export const HOME_SUMMARIES_ICONS: Record = { climate: "mdi:home-thermometer", security: "mdi:security", media_players: "mdi:multimedia", - other_devices: "mdi:devices", }; export const HOME_SUMMARIES_FILTERS: Record = { @@ -28,36 +25,6 @@ export const HOME_SUMMARIES_FILTERS: Record = { climate: climateEntityFilters, security: securityEntityFilters, media_players: [{ domain: "media_player", entity_category: "none" }], - other_devices: [ - { - area: null, - hidden_platform: [ - "automation", - "script", - "hassio", - "backup", - "mobile_app", - "zone", - "person", - ], - hidden_domains: [ - "ai_task", - "automation", - "configurator", - "device_tracker", - "event", - "geo_location", - "notify", - "persistent_notification", - "script", - "sun", - "tag", - "todo", - "zone", - ...ASSIST_ENTITIES, - ], - }, - ], }; export const getSummaryLabel = ( diff --git a/src/panels/lovelace/strategies/home/helpers/other-devices-filters.ts b/src/panels/lovelace/strategies/home/helpers/other-devices-filters.ts new file mode 100644 index 0000000000..2deca9c7c0 --- /dev/null +++ b/src/panels/lovelace/strategies/home/helpers/other-devices-filters.ts @@ -0,0 +1,33 @@ +import { ASSIST_ENTITIES } from "../../../../../common/const"; +import type { EntityFilter } from "../../../../../common/entity/entity_filter"; + +export const OTHER_DEVICES_FILTERS: EntityFilter[] = [ + { + area: null, + hidden_platform: [ + "automation", + "script", + "hassio", + "backup", + "mobile_app", + "zone", + "person", + ], + hidden_domains: [ + "ai_task", + "automation", + "configurator", + "device_tracker", + "event", + "geo_location", + "notify", + "persistent_notification", + "script", + "sun", + "tag", + "todo", + "zone", + ...ASSIST_ENTITIES, + ], + }, +]; diff --git a/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts b/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts index 8b44053820..58cf17279a 100644 --- a/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts @@ -72,13 +72,13 @@ export class HomeDashboardStrategy extends ReactiveElement { } satisfies LovelaceViewRawConfig; const otherDevicesView = { - title: getSummaryLabel(hass.localize, "other_devices"), + title: hass.localize("ui.panel.lovelace.strategy.home.devices"), path: "other-devices", subview: true, strategy: { type: "home-other-devices", }, - icon: HOME_SUMMARIES_ICONS.other_devices, + icon: "mdi:devices", } satisfies LovelaceViewRawConfig; return { diff --git a/src/panels/lovelace/strategies/home/home-other-devices-view-strategy.ts b/src/panels/lovelace/strategies/home/home-other-devices-view-strategy.ts index 92a0e293d9..673aa3c95f 100644 --- a/src/panels/lovelace/strategies/home/home-other-devices-view-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-other-devices-view-strategy.ts @@ -12,7 +12,7 @@ import type { LovelaceViewConfig } from "../../../../data/lovelace/config/view"; import type { HomeAssistant } from "../../../../types"; import { isHelperDomain } from "../../../config/helpers/const"; import type { HeadingCardConfig } from "../../cards/types"; -import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries"; +import { OTHER_DEVICES_FILTERS } from "./helpers/other-devices-filters"; export interface HomeOtherDevicesViewStrategyConfig { type: "home-other-devices"; @@ -26,8 +26,8 @@ export class HomeOtherDevicesViewStrategy extends ReactiveElement { ): Promise { const allEntities = Object.keys(hass.states); - const otherDevicesFilters = HOME_SUMMARIES_FILTERS.other_devices.map( - (filter) => generateEntityFilter(hass, filter) + const otherDevicesFilters = OTHER_DEVICES_FILTERS.map((filter) => + generateEntityFilter(hass, filter) ); const otherDevicesEntities = findEntities(allEntities, otherDevicesFilters); diff --git a/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts b/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts index 43374bc3f3..fd7d1dea0f 100644 --- a/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts @@ -27,6 +27,7 @@ import type { import type { Condition } from "../../common/validate-condition"; import type { CommonControlSectionStrategyConfig } from "../usage_prediction/common-controls-section-strategy"; import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries"; +import { OTHER_DEVICES_FILTERS } from "./helpers/other-devices-filters"; export interface HomeOverviewViewStrategyConfig { type: "home-overview"; @@ -81,8 +82,8 @@ export class HomeOverviewViewStrategy extends ReactiveElement { media_query: "(min-width: 871px)", }; - const otherDevicesFilters = HOME_SUMMARIES_FILTERS.other_devices.map( - (filter) => generateEntityFilter(hass, filter) + const otherDevicesFilters = OTHER_DEVICES_FILTERS.map((filter) => + generateEntityFilter(hass, filter) ); const entitiesWithoutAreas = findEntities(allEntities, otherDevicesFilters);