mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +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 maxCommonControls = Math.max(8, favoriteEntities.length);
|
||||||
|
|
||||||
const commonControlsSectionBase = {
|
const commonControlsSection = {
|
||||||
strategy: {
|
strategy: {
|
||||||
type: "common-controls",
|
type: "common-controls",
|
||||||
limit: maxCommonControls,
|
limit: maxCommonControls,
|
||||||
include_entities: favoriteEntities,
|
include_entities: favoriteEntities,
|
||||||
|
title: hass.localize("ui.panel.lovelace.strategy.home.favorites"),
|
||||||
hide_empty: true,
|
hide_empty: true,
|
||||||
} satisfies CommonControlSectionStrategyConfig,
|
} satisfies CommonControlSectionStrategyConfig,
|
||||||
column_span: maxColumns,
|
column_span: maxColumns,
|
||||||
} as LovelaceStrategySectionConfig;
|
} 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 allEntities = Object.keys(hass.states);
|
||||||
|
|
||||||
const mediaPlayerFilter = HOME_SUMMARIES_FILTERS.media_players.map(
|
const mediaPlayerFilter = HOME_SUMMARIES_FILTERS.media_players.map(
|
||||||
@@ -309,20 +296,8 @@ export class HomeOverviewViewStrategy extends ReactiveElement {
|
|||||||
|
|
||||||
const sections = (
|
const sections = (
|
||||||
[
|
[
|
||||||
{
|
|
||||||
type: "grid",
|
|
||||||
cards: [
|
|
||||||
// Heading to add some spacing on large screens
|
|
||||||
{
|
|
||||||
type: "heading",
|
|
||||||
heading_style: "subtitle",
|
|
||||||
visibility: [largeScreenCondition],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
mobileSummarySection,
|
mobileSummarySection,
|
||||||
commonControlsSectionMobile,
|
commonControlsSection,
|
||||||
commonControlsSectionDesktop,
|
|
||||||
...floorsSections,
|
...floorsSections,
|
||||||
] satisfies (LovelaceSectionRawConfig | undefined)[]
|
] satisfies (LovelaceSectionRawConfig | undefined)[]
|
||||||
).filter(Boolean) as LovelaceSectionRawConfig[];
|
).filter(Boolean) as LovelaceSectionRawConfig[];
|
||||||
|
|||||||
@@ -7185,7 +7185,7 @@
|
|||||||
"automations": "Automations",
|
"automations": "Automations",
|
||||||
"for_you": "For you",
|
"for_you": "For you",
|
||||||
"home": "Home",
|
"home": "Home",
|
||||||
"commonly_used": "Commonly used"
|
"favorites": "Favorites"
|
||||||
},
|
},
|
||||||
"common_controls": {
|
"common_controls": {
|
||||||
"not_loaded": "Usage Prediction integration is not loaded.",
|
"not_loaded": "Usage Prediction integration is not loaded.",
|
||||||
|
|||||||
Reference in New Issue
Block a user