import type { TServiceParams } from "@digital-alchemy/core"; import type { ByIdProxy, PICK_ENTITY, SwitchDeviceClass } from "@digital-alchemy/hass"; import type { AddEntityOptions, BasicAddParams, CallbackData, SettableConfiguration, SynapseEntityProxy } from "../../helpers/index.mts"; export type SwitchConfiguration = { device_class?: `${SwitchDeviceClass}`; /** * If the switch is currently on or off. */ is_on?: SettableConfiguration; /** * default: true */ managed?: boolean; }; export type SwitchEvents = { turn_on: {}; turn_off: {}; toggle: {}; }; /** * Convenient type for switch entities with optional attributes and locals */ export type SynapseSwitch = SynapseEntityProxy, SwitchEvents, ATTRIBUTES, LOCALS, DATA, PICK_ENTITY<"switch">> & { entity: ByIdProxy>; }; export declare function VirtualSwitch({ context, synapse, logger }: TServiceParams): >>({ managed, ...options }: AddEntityOptions, SwitchEvents, PARAMS["attributes"], PARAMS["locals"], DATA>) => SynapseSwitch;