import type { IFullBlocksClient, IEntity } from '../types/index.ts'; import { Entity } from './entity.ts'; import { type IMQTTConnection } from '@hass-blocks/hass-mqtt'; /** * @public * * Configuration for switch entity. When 'create' is false, this simply * refers to an existing switch entity */ export interface SwitchConfig { /** * The entity id */ id: TId; /** * Whether or not to create the entity */ create: false; } /** * @public * * When the 'create' parameter is supplied as true, this entity * will try to create a new switch in Home Assisstant so long as there is * an initialised MQTT connection */ export interface SwitchConfigForCreation { /** * The entity id */ id: TId; /** * Whether or not to create the entity */ create: true; /** * The friendly name for the Entity in Home Assistant */ friendlyName: string; } /** * @public * * A switch entity */ export declare class Switch extends Entity { private config; private mqttSwitch; constructor(config: SwitchConfig | SwitchConfigForCreation); get targetIds(): { entity_id: TId[]; }; initialise(hass: IFullBlocksClient, mqtt: IMQTTConnection): Promise; } /** * @public * * A switch entity * * @param config - switch config */ export declare function toggle(config: SwitchConfig | SwitchConfigForCreation): IEntity; /** * @public * * A switch entity * * @param id - An entity id */ export declare function toggle(id: TId): IEntity; //# sourceMappingURL=switch.d.ts.map