Add rebuild support to editor preview (#4932)

* Add rebuild support to editor preview

* getLovelaceCardClass function added

* Use error class

* Tiny cleanup

* Misplaced comment
This commit is contained in:
Paulus Schoutsen
2020-02-20 00:55:42 -08:00
committed by GitHub
parent 6d54496187
commit 52609dded9
7 changed files with 112 additions and 34 deletions

View File

@@ -11,7 +11,10 @@ import "../cards/hui-thermostat-card";
import "../cards/hui-vertical-stack-card";
import "../cards/hui-weather-forecast-card";
import { LovelaceCardConfig } from "../../../data/lovelace";
import { createLovelaceElement } from "./create-element-base";
import {
createLovelaceElement,
getLovelaceElementClass,
} from "./create-element-base";
const ALWAYS_LOADED_TYPES = new Set([
"entities",
@@ -56,3 +59,6 @@ export const createCardElement = (config: LovelaceCardConfig) =>
undefined,
undefined
);
export const getCardElementClass = (type: string) =>
getLovelaceElementClass(type, "card", ALWAYS_LOADED_TYPES, LAZY_LOAD_TYPES);