Skip to content

Commit

Permalink
make custom domains more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts committed Jul 14, 2024
1 parent f51f746 commit 753622c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/data/preview.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { UnsubscribeFunc } from "home-assistant-js-websocket";
import { HomeAssistant } from "../types";

const HAS_CUSTOM_PREVIEW = ["template"];

export interface GenericPreview {
state: string;
attributes: Record<string, any>;
Expand All @@ -22,4 +24,4 @@ export const subscribePreviewGeneric = (
});

export const previewModule = (domain: string): string =>
["template"].includes(domain) ? domain : "generic";
HAS_CUSTOM_PREVIEW.includes(domain) ? domain : "generic";

0 comments on commit 753622c

Please sign in to comment.