From d819f784ace1ab2e703047345857c38144aa75f4 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Mon, 15 Dec 2025 15:06:35 +0100 Subject: [PATCH] Rename unassigned to other --- .../lovelace/cards/hui-home-summary-card.ts | 2 +- src/panels/lovelace/strategies/get-strategy.ts | 4 ++-- .../strategies/home/helpers/home-summaries.ts | 6 +++--- .../strategies/home/home-dashboard-strategy.ts | 12 ++++++------ ....ts => home-other-devices-view-strategy.ts} | 18 +++++++++--------- .../home/home-overview-view-strategy.ts | 10 +++++----- src/translations/en.json | 2 +- 7 files changed, 27 insertions(+), 27 deletions(-) rename src/panels/lovelace/strategies/home/{home-unassigned-devices-view-strategy.ts => home-other-devices-view-strategy.ts} (90%) diff --git a/src/panels/lovelace/cards/hui-home-summary-card.ts b/src/panels/lovelace/cards/hui-home-summary-card.ts index d53db76fe2..90f580a36a 100644 --- a/src/panels/lovelace/cards/hui-home-summary-card.ts +++ b/src/panels/lovelace/cards/hui-home-summary-card.ts @@ -35,7 +35,7 @@ const COLORS: Record = { climate: "deep-orange", security: "blue-grey", media_players: "blue", - unassigned_devices: "grey", + other_devices: "grey", }; @customElement("hui-home-summary-card") diff --git a/src/panels/lovelace/strategies/get-strategy.ts b/src/panels/lovelace/strategies/get-strategy.ts index a1a9ae9ccb..5295902508 100644 --- a/src/panels/lovelace/strategies/get-strategy.ts +++ b/src/panels/lovelace/strategies/get-strategy.ts @@ -52,8 +52,8 @@ const STRATEGIES: Record> = { "home-media-players": () => import("./home/home-media-players-view-strategy"), "home-area": () => import("./home/home-area-view-strategy"), - "home-unassigned-devices": () => - import("./home/home-unassigned-devices-view-strategy"), + "home-other-devices": () => + import("./home/home-other-devices-view-strategy"), light: () => import("../../light/strategies/light-view-strategy"), security: () => import("../../security/strategies/security-view-strategy"), climate: () => import("../../climate/strategies/climate-view-strategy"), diff --git a/src/panels/lovelace/strategies/home/helpers/home-summaries.ts b/src/panels/lovelace/strategies/home/helpers/home-summaries.ts index 6ccd4a7266..ea56a8ff6c 100644 --- a/src/panels/lovelace/strategies/home/helpers/home-summaries.ts +++ b/src/panels/lovelace/strategies/home/helpers/home-summaries.ts @@ -10,7 +10,7 @@ export const HOME_SUMMARIES = [ "climate", "security", "media_players", - "unassigned_devices", + "other_devices", ] as const; export type HomeSummary = (typeof HOME_SUMMARIES)[number]; @@ -20,7 +20,7 @@ export const HOME_SUMMARIES_ICONS: Record = { climate: "mdi:home-thermometer", security: "mdi:security", media_players: "mdi:multimedia", - unassigned_devices: "mdi:shape", + other_devices: "mdi:devices", }; export const HOME_SUMMARIES_FILTERS: Record = { @@ -28,7 +28,7 @@ export const HOME_SUMMARIES_FILTERS: Record = { climate: climateEntityFilters, security: securityEntityFilters, media_players: [{ domain: "media_player", entity_category: "none" }], - unassigned_devices: [ + other_devices: [ { area: null, hidden_platform: [ diff --git a/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts b/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts index 6a7c2fa012..8b44053820 100644 --- a/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-dashboard-strategy.ts @@ -71,14 +71,14 @@ export class HomeDashboardStrategy extends ReactiveElement { icon: HOME_SUMMARIES_ICONS.media_players, } satisfies LovelaceViewRawConfig; - const unassignedDevicesView = { - title: getSummaryLabel(hass.localize, "unassigned_devices"), - path: "unassigned-devices", + const otherDevicesView = { + title: getSummaryLabel(hass.localize, "other_devices"), + path: "other-devices", subview: true, strategy: { - type: "home-unassigned-devices", + type: "home-other-devices", }, - icon: HOME_SUMMARIES_ICONS.unassigned_devices, + icon: HOME_SUMMARIES_ICONS.other_devices, } satisfies LovelaceViewRawConfig; return { @@ -93,7 +93,7 @@ export class HomeDashboardStrategy extends ReactiveElement { }, ...areaViews, mediaPlayersView, - unassignedDevicesView, + otherDevicesView, ], }; } diff --git a/src/panels/lovelace/strategies/home/home-unassigned-devices-view-strategy.ts b/src/panels/lovelace/strategies/home/home-other-devices-view-strategy.ts similarity index 90% rename from src/panels/lovelace/strategies/home/home-unassigned-devices-view-strategy.ts rename to src/panels/lovelace/strategies/home/home-other-devices-view-strategy.ts index a846b0b36c..92a0e293d9 100644 --- a/src/panels/lovelace/strategies/home/home-unassigned-devices-view-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-other-devices-view-strategy.ts @@ -14,29 +14,29 @@ import { isHelperDomain } from "../../../config/helpers/const"; import type { HeadingCardConfig } from "../../cards/types"; import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries"; -export interface HomeUnassignedDevicesViewStrategyConfig { - type: "home-unassigned-devices"; +export interface HomeOtherDevicesViewStrategyConfig { + type: "home-other-devices"; } -@customElement("home-unassigned-devices-view-strategy") -export class HomeUnassignedDevicesViewStrategy extends ReactiveElement { +@customElement("home-other-devices-view-strategy") +export class HomeOtherDevicesViewStrategy extends ReactiveElement { static async generate( - _config: HomeUnassignedDevicesViewStrategyConfig, + _config: HomeOtherDevicesViewStrategyConfig, hass: HomeAssistant ): Promise { const allEntities = Object.keys(hass.states); - const unassignedFilters = HOME_SUMMARIES_FILTERS.unassigned_devices.map( + const otherDevicesFilters = HOME_SUMMARIES_FILTERS.other_devices.map( (filter) => generateEntityFilter(hass, filter) ); - const unassignedEntities = findEntities(allEntities, unassignedFilters); + const otherDevicesEntities = findEntities(allEntities, otherDevicesFilters); const sections: LovelaceSectionRawConfig[] = []; const entitiesByDevice: Record = {}; const entitiesWithoutDevices: string[] = []; - for (const entityId of unassignedEntities) { + for (const entityId of otherDevicesEntities) { const stateObj = hass.states[entityId]; if (!stateObj) continue; const { device } = getEntityContext( @@ -202,6 +202,6 @@ export class HomeUnassignedDevicesViewStrategy extends ReactiveElement { declare global { interface HTMLElementTagNameMap { - "home-unassigned-devices-view-strategy": HomeUnassignedDevicesViewStrategy; + "home-other-devices-view-strategy": HomeOtherDevicesViewStrategy; } } 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 7140ebeb7f..6e0731b83c 100644 --- a/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts @@ -81,11 +81,11 @@ export class HomeOverviewViewStrategy extends ReactiveElement { media_query: "(min-width: 871px)", }; - const unassignedFilters = HOME_SUMMARIES_FILTERS.unassigned_devices.map( + const otherDevicesFilters = HOME_SUMMARIES_FILTERS.other_devices.map( (filter) => generateEntityFilter(hass, filter) ); - const entitiesWithoutAreas = findEntities(allEntities, unassignedFilters); + const entitiesWithoutAreas = findEntities(allEntities, otherDevicesFilters); const floorsSections: LovelaceSectionConfig[] = []; for (const floorStructure of home.floors) { @@ -134,7 +134,7 @@ export class HomeOverviewViewStrategy extends ReactiveElement { hide_state: true, tap_action: { action: "navigate", - navigation_path: "unassigned-devices", + navigation_path: "other-devices", }, grid_options: { rows: 2, @@ -262,11 +262,11 @@ export class HomeOverviewViewStrategy extends ReactiveElement { } satisfies HomeSummaryCard), { type: "home-summary", - summary: "unassigned_devices", + summary: "other_devices", vertical: true, tap_action: { action: "navigate", - navigation_path: "unassigned-devices", + navigation_path: "other-devices", }, grid_options: { rows: 2, diff --git a/src/translations/en.json b/src/translations/en.json index b6b0927f1a..d8070c7b69 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -7153,7 +7153,7 @@ "home": { "summary_list": { "media_players": "Media players", - "unassigned_devices": "Unassigned devices" + "other_devices": "Other devices" }, "welcome_user": "Welcome {user}", "summaries": "Summaries",