mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-19 18:28:42 +00:00
Always add favorite heading for home overview (#28629)
This commit is contained in:
@@ -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[];
|
||||
|
||||
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user