UNPKG

homebridge-calypshome

Version:
143 lines 4.27 kB
import { Logging } from 'homebridge'; import { EventEmitter } from 'events'; import { z } from 'zod'; import { RollingShutter } from './rollingShutter'; export declare const getObjectsSchema: z.ZodObject<{ objects: z.ZodArray<z.ZodObject<{ room: z.ZodObject<{ id: z.ZodNumber; name: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; id: number; }, { name: string; id: number; }>; id: z.ZodString; status: z.ZodArray<z.ZodObject<{ value: z.ZodString; name: z.ZodString; time: z.ZodString; }, "strip", z.ZodTypeAny, { name: string; time: string; value: string; }, { name: string; time: string; value: string; }>, "many">; categories: z.ZodUnknown; name: z.ZodString; type: z.ZodEnum<["Rolling_Shutter", "Composite", "EZSP"]>; img: z.ZodString; gw: z.ZodString; eventId: z.ZodString; connected: z.ZodBoolean; actions: z.ZodArray<z.ZodEnum<["OPEN", "CLOSE", "STOP", "LEVEL", "TILT", "SCAN", "JOIN"]>, "many">; }, "strip", z.ZodTypeAny, { name: string; type: "Rolling_Shutter" | "Composite" | "EZSP"; id: string; connected: boolean; img: string; status: { name: string; time: string; value: string; }[]; room: { name: string; id: number; }; gw: string; eventId: string; actions: ("OPEN" | "CLOSE" | "STOP" | "LEVEL" | "TILT" | "SCAN" | "JOIN")[]; categories?: unknown; }, { name: string; type: "Rolling_Shutter" | "Composite" | "EZSP"; id: string; connected: boolean; img: string; status: { name: string; time: string; value: string; }[]; room: { name: string; id: number; }; gw: string; eventId: string; actions: ("OPEN" | "CLOSE" | "STOP" | "LEVEL" | "TILT" | "SCAN" | "JOIN")[]; categories?: unknown; }>, "many">; }, "strip", z.ZodTypeAny, { objects: { name: string; type: "Rolling_Shutter" | "Composite" | "EZSP"; id: string; connected: boolean; img: string; status: { name: string; time: string; value: string; }[]; room: { name: string; id: number; }; gw: string; eventId: string; actions: ("OPEN" | "CLOSE" | "STOP" | "LEVEL" | "TILT" | "SCAN" | "JOIN")[]; categories?: unknown; }[]; }, { objects: { name: string; type: "Rolling_Shutter" | "Composite" | "EZSP"; id: string; connected: boolean; img: string; status: { name: string; time: string; value: string; }[]; room: { name: string; id: number; }; gw: string; eventId: string; actions: ("OPEN" | "CLOSE" | "STOP" | "LEVEL" | "TILT" | "SCAN" | "JOIN")[]; categories?: unknown; }[]; }>; export declare interface CalypshomeAPI { on(event: typeof CalypshomeAPI.DEVICE_UPDATE, listener: (device: RollingShutter, type: 'angle' | 'level' | 'status') => void): this; } export declare class CalypshomeAPI extends EventEmitter { readonly logger: Logging; private url; private wsUrl; private inMemoryDevices; private ws; static DEVICE_UPDATE: string; constructor(config: { url: string; }, logger: Logging); close(): void; devices(): Promise<RollingShutter[]>; action(id: string, action: 'STOP' | 'CLOSE' | 'OPEN' | 'LEVEL' | 'TILT', args?: Record<string, string>): Promise<boolean>; private apiCall; device(id: string): RollingShutter | undefined; connectWebSocket(): void; private handleWebSocketMessage; update(device: RollingShutter, key: 'angle' | 'level' | 'status', value: string): void; } //# sourceMappingURL=calypshomeAPI.d.ts.map