mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-28 04:34:11 +01:00
Add formatEntityName helper on hass object. (#26057)
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import type { EntityRegistryDisplayEntry } from "../../../../src/data/entity_registry";
|
||||
import type { DeviceRegistryEntry } from "../../../../src/data/device_registry";
|
||||
import type { AreaRegistryEntry } from "../../../../src/data/area_registry";
|
||||
import type { DeviceRegistryEntry } from "../../../../src/data/device_registry";
|
||||
import type {
|
||||
EntityRegistryDisplayEntry,
|
||||
EntityRegistryEntry,
|
||||
} from "../../../../src/data/entity_registry";
|
||||
import type { FloorRegistryEntry } from "../../../../src/data/floor_registry";
|
||||
|
||||
export const mockStateObj = (partial: Partial<HassEntity>): HassEntity => ({
|
||||
@@ -26,6 +29,31 @@ export const mockEntity = (
|
||||
...partial,
|
||||
});
|
||||
|
||||
export const mockEntityEntry = (
|
||||
partial: Partial<EntityRegistryEntry>
|
||||
): EntityRegistryEntry => ({
|
||||
entity_id: "",
|
||||
name: null,
|
||||
icon: null,
|
||||
platform: "",
|
||||
config_entry_id: null,
|
||||
config_subentry_id: null,
|
||||
device_id: null,
|
||||
area_id: null,
|
||||
labels: [],
|
||||
disabled_by: null,
|
||||
hidden_by: null,
|
||||
entity_category: null,
|
||||
has_entity_name: false,
|
||||
unique_id: "",
|
||||
id: "",
|
||||
options: null,
|
||||
categories: {},
|
||||
created_at: 0,
|
||||
modified_at: 0,
|
||||
...partial,
|
||||
});
|
||||
|
||||
export const mockDevice = (
|
||||
partial: Partial<DeviceRegistryEntry>
|
||||
): DeviceRegistryEntry => ({
|
||||
|
||||
Reference in New Issue
Block a user