import { LovelaceTileFeatureConfig } from "../tile-features/types";
import {
  createLovelaceElement,
  getLovelaceElementClass,
} from "./create-element-base";
import "../tile-features/hui-cover-open-close-tile-feature";
import "../tile-features/hui-cover-tilt-tile-feature";
import "../tile-features/hui-light-brightness-tile-feature";
import "../tile-features/hui-vacuum-commands-tile-feature";

const TYPES: Set<LovelaceTileFeatureConfig["type"]> = new Set([
  "cover-open-close",
  "cover-tilt",
  "light-brightness",
  "vacuum-commands",
]);

export const createTileFeatureElement = (config: LovelaceTileFeatureConfig) =>
  createLovelaceElement("tile-feature", config, TYPES);

export const getTileFeatureElementClass = (type: string) =>
  getLovelaceElementClass(type, "tile-feature", TYPES);
