mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Rename home dashboard path and strategy name (#28104)
This commit is contained in:
@@ -46,7 +46,7 @@ const STRATEGIES: Record<LovelaceStrategyConfigType, Record<string, any>> = {
|
||||
iframe: () => import("./iframe/iframe-view-strategy"),
|
||||
area: () => import("./areas/area-view-strategy"),
|
||||
"areas-overview": () => import("./areas/areas-overview-view-strategy"),
|
||||
"home-main": () => import("./home/home-main-view-strategy"),
|
||||
"home-overview": () => import("./home/home-overview-view-strategy"),
|
||||
"home-media-players": () =>
|
||||
import("./home/home-media-players-view-strategy"),
|
||||
"home-area": () => import("./home/home-area-view-strategy"),
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
HOME_SUMMARIES_ICONS,
|
||||
} from "./helpers/home-summaries";
|
||||
import type { HomeAreaViewStrategyConfig } from "./home-area-view-strategy";
|
||||
import type { HomeMainViewStrategyConfig } from "./home-main-view-strategy";
|
||||
import type { HomeOverviewViewStrategyConfig } from "./home-overview-view-strategy";
|
||||
|
||||
export interface HomeDashboardStrategyConfig {
|
||||
type: "home";
|
||||
@@ -75,11 +75,11 @@ export class HomeDashboardStrategy extends ReactiveElement {
|
||||
views: [
|
||||
{
|
||||
icon: "mdi:home",
|
||||
path: "home",
|
||||
path: "overview",
|
||||
strategy: {
|
||||
type: "home-main",
|
||||
type: "home-overview",
|
||||
favorite_entities: config.favorite_entities,
|
||||
} satisfies HomeMainViewStrategyConfig,
|
||||
} satisfies HomeOverviewViewStrategyConfig,
|
||||
},
|
||||
...areaViews,
|
||||
mediaPlayersView,
|
||||
|
||||
@@ -26,8 +26,8 @@ import type { CommonControlSectionStrategyConfig } from "../usage_prediction/com
|
||||
import { getAreasFloorHierarchy } from "../../../../common/areas/areas-floor-hierarchy";
|
||||
import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries";
|
||||
|
||||
export interface HomeMainViewStrategyConfig {
|
||||
type: "home-main";
|
||||
export interface HomeOverviewViewStrategyConfig {
|
||||
type: "home-overview";
|
||||
favorite_entities?: string[];
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ const computeAreaCard = (
|
||||
};
|
||||
};
|
||||
|
||||
@customElement("home-main-view-strategy")
|
||||
export class HomeMainViewStrategy extends ReactiveElement {
|
||||
@customElement("home-overview-view-strategy")
|
||||
export class HomeOverviewViewStrategy extends ReactiveElement {
|
||||
static async generate(
|
||||
config: HomeMainViewStrategyConfig,
|
||||
config: HomeOverviewViewStrategyConfig,
|
||||
hass: HomeAssistant
|
||||
): Promise<LovelaceViewConfig> {
|
||||
const areas = Object.values(hass.areas);
|
||||
@@ -325,6 +325,6 @@ export class HomeMainViewStrategy extends ReactiveElement {
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"home-main-view-strategy": HomeMainViewStrategy;
|
||||
"home-overview-view-strategy": HomeOverviewViewStrategy;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user