mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-20 17:43:36 +00:00
20 lines
542 B
TypeScript
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 });
|