Add unique_id to entity registry (#13886)

This commit is contained in:
Paul Bottein 2022-09-27 15:39:14 +02:00 committed by GitHub
parent 01fd2787be
commit cc76a6c5ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 2 deletions

View File

@ -68,6 +68,7 @@ class HaDemo extends HomeAssistantAppEl {
hidden_by: null, hidden_by: null,
entity_category: null, entity_category: null,
has_entity_name: false, has_entity_name: false,
unique_id: "co2_intensity",
}, },
{ {
config_entry_id: "co2signal", config_entry_id: "co2signal",
@ -82,6 +83,7 @@ class HaDemo extends HomeAssistantAppEl {
hidden_by: null, hidden_by: null,
entity_category: null, entity_category: null,
has_entity_name: false, has_entity_name: false,
unique_id: "grid_fossil_fuel_percentage",
}, },
]); ]);

View File

@ -196,6 +196,7 @@ const createEntityRegistryEntries = (
icon: null, icon: null,
platform: "updater", platform: "updater",
has_entity_name: false, has_entity_name: false,
unique_id: "updater",
}, },
]; ];

View File

@ -20,10 +20,10 @@ export interface EntityRegistryEntry {
entity_category: "config" | "diagnostic" | null; entity_category: "config" | "diagnostic" | null;
has_entity_name: boolean; has_entity_name: boolean;
original_name?: string; original_name?: string;
unique_id: string;
} }
export interface ExtEntityRegistryEntry extends EntityRegistryEntry { export interface ExtEntityRegistryEntry extends EntityRegistryEntry {
unique_id: string;
capabilities: Record<string, unknown>; capabilities: Record<string, unknown>;
original_icon?: string; original_icon?: string;
device_class?: string; device_class?: string;

View File

@ -68,10 +68,12 @@ import type { HomeAssistant, Route } from "../../../types";
import { configSections } from "../ha-panel-config"; import { configSections } from "../ha-panel-config";
import "../integrations/ha-integration-overflow-menu"; import "../integrations/ha-integration-overflow-menu";
export interface StateEntity extends Omit<EntityRegistryEntry, "id"> { export interface StateEntity
extends Omit<EntityRegistryEntry, "id" | "unique_id"> {
readonly?: boolean; readonly?: boolean;
selectable?: boolean; selectable?: boolean;
id?: string; id?: string;
unique_id?: string;
} }
export interface EntityRow extends StateEntity { export interface EntityRow extends StateEntity {