mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 04:46:34 +00:00
Fix demo stub
This commit is contained in:
parent
4ff2d941c3
commit
9fc8c0764c
@ -15,6 +15,7 @@ import { mockTemplate } from "./stubs/template";
|
|||||||
import { mockEvents } from "./stubs/events";
|
import { mockEvents } from "./stubs/events";
|
||||||
import { mockMediaPlayer } from "./stubs/media_player";
|
import { mockMediaPlayer } from "./stubs/media_player";
|
||||||
import { HomeAssistant } from "../../src/types";
|
import { HomeAssistant } from "../../src/types";
|
||||||
|
import { mockFrontend } from "./stubs/frontend";
|
||||||
|
|
||||||
class HaDemo extends HomeAssistantAppEl {
|
class HaDemo extends HomeAssistantAppEl {
|
||||||
protected async _handleConnProm() {
|
protected async _handleConnProm() {
|
||||||
@ -35,6 +36,7 @@ class HaDemo extends HomeAssistantAppEl {
|
|||||||
mockTemplate(hass);
|
mockTemplate(hass);
|
||||||
mockEvents(hass);
|
mockEvents(hass);
|
||||||
mockMediaPlayer(hass);
|
mockMediaPlayer(hass);
|
||||||
|
mockFrontend(hass);
|
||||||
selectedDemoConfig.then((conf) => {
|
selectedDemoConfig.then((conf) => {
|
||||||
hass.addEntities(conf.entities());
|
hass.addEntities(conf.entities());
|
||||||
if (conf.theme) {
|
if (conf.theme) {
|
||||||
|
7
demo/src/stubs/frontend.ts
Normal file
7
demo/src/stubs/frontend.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||||
|
|
||||||
|
export const mockFrontend = (hass: MockHomeAssistant) => {
|
||||||
|
hass.mockWS("frontend/get_user_data", () => ({
|
||||||
|
value: null,
|
||||||
|
}));
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user