Files
frontend/src/data/text.ts
Wendelin 830d8d2410 Add type import check to eslint (#22488)
* Add type import check to eslint

* Add type imports with eslint --fix
2024-10-30 11:12:30 +00:00

20 lines
542 B
TypeScript

import type {
HassEntityAttributeBase,
HassEntityBase,
} from "home-assistant-js-websocket";
import type { HomeAssistant } from "../types";
interface TextEntityAttributes extends HassEntityAttributeBase {
min?: number;
max?: number;
pattern?: string;
mode?: "text" | "password";
}
export interface TextEntity extends HassEntityBase {
attributes: TextEntityAttributes;
}
export const setValue = (hass: HomeAssistant, entity: string, value: string) =>
hass.callService("text", "set_value", { value }, { entity_id: entity });