From 23e394fec9290d5b2f556b2f21af4651353895b1 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Fri, 19 Dec 2025 12:35:44 +0100 Subject: [PATCH] Always add favorite heading for home overview (#28629) --- .../home/home-overview-view-strategy.ts | 31 ++----------------- src/translations/en.json | 2 +- 2 files changed, 4 insertions(+), 29 deletions(-) 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 2c76214f18..6cae85110b 100644 --- a/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-overview-view-strategy.ts @@ -141,30 +141,17 @@ export class HomeOverviewViewStrategy extends ReactiveElement { ); const maxCommonControls = Math.max(8, favoriteEntities.length); - const commonControlsSectionBase = { + const commonControlsSection = { strategy: { type: "common-controls", limit: maxCommonControls, include_entities: favoriteEntities, + title: hass.localize("ui.panel.lovelace.strategy.home.favorites"), hide_empty: true, } satisfies CommonControlSectionStrategyConfig, column_span: maxColumns, } as LovelaceStrategySectionConfig; - const commonControlsSectionMobile = { - ...commonControlsSectionBase, - strategy: { - ...commonControlsSectionBase.strategy, - title: hass.localize("ui.panel.lovelace.strategy.home.commonly_used"), - }, - visibility: [smallScreenCondition], - } as LovelaceStrategySectionConfig; - - const commonControlsSectionDesktop = { - ...commonControlsSectionBase, - visibility: [largeScreenCondition], - } as LovelaceStrategySectionConfig; - const allEntities = Object.keys(hass.states); const mediaPlayerFilter = HOME_SUMMARIES_FILTERS.media_players.map( @@ -309,20 +296,8 @@ export class HomeOverviewViewStrategy extends ReactiveElement { const sections = ( [ - { - type: "grid", - cards: [ - // Heading to add some spacing on large screens - { - type: "heading", - heading_style: "subtitle", - visibility: [largeScreenCondition], - }, - ], - }, mobileSummarySection, - commonControlsSectionMobile, - commonControlsSectionDesktop, + commonControlsSection, ...floorsSections, ] satisfies (LovelaceSectionRawConfig | undefined)[] ).filter(Boolean) as LovelaceSectionRawConfig[]; diff --git a/src/translations/en.json b/src/translations/en.json index c109d818af..cf380ba862 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -7185,7 +7185,7 @@ "automations": "Automations", "for_you": "For you", "home": "Home", - "commonly_used": "Commonly used" + "favorites": "Favorites" }, "common_controls": { "not_loaded": "Usage Prediction integration is not loaded.",