mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-21 10:17:13 +00:00
26 lines
530 B
TypeScript
26 lines
530 B
TypeScript
import type {
|
|
HassEntityAttributeBase,
|
|
HassEntityBase,
|
|
} from "home-assistant-js-websocket";
|
|
import type { HomeAssistant } from "../types";
|
|
|
|
interface SelectEntityAttributes extends HassEntityAttributeBase {
|
|
options: string[];
|
|
}
|
|
|
|
export interface SelectEntity extends HassEntityBase {
|
|
attributes: SelectEntityAttributes;
|
|
}
|
|
|
|
export const setSelectOption = (
|
|
hass: HomeAssistant,
|
|
entity: string,
|
|
option: string
|
|
) =>
|
|
hass.callService(
|
|
"select",
|
|
"select_option",
|
|
{ option },
|
|
{ entity_id: entity }
|
|
);
|