mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Use const everywhere for "group.default_view" (#8918)
This commit is contained in:
parent
9d29b55bee
commit
f6e223c18d
@ -3,6 +3,8 @@ import {
|
||||
HassEntity,
|
||||
STATE_NOT_RUNNING,
|
||||
} from "home-assistant-js-websocket";
|
||||
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
||||
import { DEFAULT_VIEW_ENTITY_ID } from "../../../common/const";
|
||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||
import { computeObjectId } from "../../../common/entity/compute_object_id";
|
||||
import { computeStateDomain } from "../../../common/entity/compute_state_domain";
|
||||
@ -13,7 +15,6 @@ import { splitByGroups } from "../../../common/entity/split_by_groups";
|
||||
import { compare } from "../../../common/string/compare";
|
||||
import { LocalizeFunc } from "../../../common/translations/localize";
|
||||
import { subscribeOne } from "../../../common/util/subscribe-one";
|
||||
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
|
||||
import {
|
||||
AreaRegistryEntry,
|
||||
subscribeAreaRegistry,
|
||||
@ -45,7 +46,6 @@ import {
|
||||
} from "../cards/types";
|
||||
import { LovelaceRowConfig } from "../entity-rows/types";
|
||||
|
||||
const DEFAULT_VIEW_ENTITY_ID = "group.default_view";
|
||||
const HIDE_DOMAIN = new Set([
|
||||
"automation",
|
||||
"configurator",
|
||||
@ -181,7 +181,8 @@ export const computeCards = (
|
||||
titlePrefix &&
|
||||
stateObj &&
|
||||
// eslint-disable-next-line no-cond-assign
|
||||
(name = computeStateName(stateObj)) !== titlePrefix && name.startsWith(titlePrefix)
|
||||
(name = computeStateName(stateObj)) !== titlePrefix &&
|
||||
name.startsWith(titlePrefix)
|
||||
? {
|
||||
entity: entityId,
|
||||
name: adjustName(name.substr(titlePrefix.length)),
|
||||
|
@ -1,7 +1,6 @@
|
||||
import * as assert from "assert";
|
||||
|
||||
import { DEFAULT_VIEW_ENTITY_ID } from "../../../src/common/const";
|
||||
import { extractViews } from "../../../src/common/entity/extract_views";
|
||||
|
||||
import { createEntities, createView } from "./test_util";
|
||||
|
||||
describe("extractViews", () => {
|
||||
@ -14,7 +13,7 @@ describe("extractViews", () => {
|
||||
entities[view2.entity_id] = view2;
|
||||
|
||||
const view3 = createView({
|
||||
entity_id: "group.default_view",
|
||||
entity_id: DEFAULT_VIEW_ENTITY_ID,
|
||||
attributes: { order: 8 },
|
||||
});
|
||||
entities[view3.entity_id] = view3;
|
||||
|
Loading…
x
Reference in New Issue
Block a user