mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-08 18:39:40 +00:00
18 lines
562 B
TypeScript
18 lines
562 B
TypeScript
import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
|
|
|
export const mockTemplate = (hass: MockHomeAssistant) => {
|
|
hass.mockAPI("template", () =>
|
|
Promise.reject({
|
|
body: { message: "Template dev tool does not work in the demo." },
|
|
})
|
|
);
|
|
hass.mockWS("render_template", (msg, _hass, onChange) => {
|
|
onChange!({
|
|
result: msg.template,
|
|
listeners: { all: false, domains: [], entities: [], time: false },
|
|
});
|
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
return () => {};
|
|
});
|
|
};
|