mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-24 04:39:01 +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"),
|
iframe: () => import("./iframe/iframe-view-strategy"),
|
||||||
area: () => import("./areas/area-view-strategy"),
|
area: () => import("./areas/area-view-strategy"),
|
||||||
"areas-overview": () => import("./areas/areas-overview-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": () =>
|
"home-media-players": () =>
|
||||||
import("./home/home-media-players-view-strategy"),
|
import("./home/home-media-players-view-strategy"),
|
||||||
"home-area": () => import("./home/home-area-view-strategy"),
|
"home-area": () => import("./home/home-area-view-strategy"),
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
HOME_SUMMARIES_ICONS,
|
HOME_SUMMARIES_ICONS,
|
||||||
} from "./helpers/home-summaries";
|
} from "./helpers/home-summaries";
|
||||||
import type { HomeAreaViewStrategyConfig } from "./home-area-view-strategy";
|
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 {
|
export interface HomeDashboardStrategyConfig {
|
||||||
type: "home";
|
type: "home";
|
||||||
@@ -75,11 +75,11 @@ export class HomeDashboardStrategy extends ReactiveElement {
|
|||||||
views: [
|
views: [
|
||||||
{
|
{
|
||||||
icon: "mdi:home",
|
icon: "mdi:home",
|
||||||
path: "home",
|
path: "overview",
|
||||||
strategy: {
|
strategy: {
|
||||||
type: "home-main",
|
type: "home-overview",
|
||||||
favorite_entities: config.favorite_entities,
|
favorite_entities: config.favorite_entities,
|
||||||
} satisfies HomeMainViewStrategyConfig,
|
} satisfies HomeOverviewViewStrategyConfig,
|
||||||
},
|
},
|
||||||
...areaViews,
|
...areaViews,
|
||||||
mediaPlayersView,
|
mediaPlayersView,
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ import type { CommonControlSectionStrategyConfig } from "../usage_prediction/com
|
|||||||
import { getAreasFloorHierarchy } from "../../../../common/areas/areas-floor-hierarchy";
|
import { getAreasFloorHierarchy } from "../../../../common/areas/areas-floor-hierarchy";
|
||||||
import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries";
|
import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries";
|
||||||
|
|
||||||
export interface HomeMainViewStrategyConfig {
|
export interface HomeOverviewViewStrategyConfig {
|
||||||
type: "home-main";
|
type: "home-overview";
|
||||||
favorite_entities?: string[];
|
favorite_entities?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,10 +57,10 @@ const computeAreaCard = (
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@customElement("home-main-view-strategy")
|
@customElement("home-overview-view-strategy")
|
||||||
export class HomeMainViewStrategy extends ReactiveElement {
|
export class HomeOverviewViewStrategy extends ReactiveElement {
|
||||||
static async generate(
|
static async generate(
|
||||||
config: HomeMainViewStrategyConfig,
|
config: HomeOverviewViewStrategyConfig,
|
||||||
hass: HomeAssistant
|
hass: HomeAssistant
|
||||||
): Promise<LovelaceViewConfig> {
|
): Promise<LovelaceViewConfig> {
|
||||||
const areas = Object.values(hass.areas);
|
const areas = Object.values(hass.areas);
|
||||||
@@ -325,6 +325,6 @@ export class HomeMainViewStrategy extends ReactiveElement {
|
|||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
"home-main-view-strategy": HomeMainViewStrategy;
|
"home-overview-view-strategy": HomeOverviewViewStrategy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user