import { AxiosRequestConfig } from 'axios'; import { SmartRentPlatform } from '../platform'; import WebSocket from 'ws'; export declare type WSDeviceList = `devices:${string}`; export declare type WSEvent = { id: number; name: 'leak' | 'fan_mode' | 'current_temp' | 'current_humidity' | 'heating_setpoint' | 'cooling_setpoint' | 'mode' | 'locked' | 'on' | 'notifications'; remote_id: string; type: string; last_read_state: string; last_read_state_changed_at: string; }; export declare type WSPayload = [null, null, WSDeviceList, string, WSEvent]; export declare class SmartRentApiClient { readonly platform: SmartRentPlatform; private authClient; private readonly apiClient; constructor(platform: SmartRentPlatform); /** * Initialize Axios instance for SmartRent API requests * @returns Axios instance */ private _initializeApiClient; /** * Get the SmartRent API access token * @returns Oauth access token */ getAccessToken(): Promise; /** * Attach the access token to the SmartRent API request and log the request * @param config Axios request config * @returns Axios request config */ private _handleRequest; /** * Log the SmartRent API response * @param response Axios response * @returns SmartRent response data payload */ private _handleResponse; get(path: string, config?: AxiosRequestConfig): Promise; post(path: string, data?: D, config?: AxiosRequestConfig): Promise; patch(path: string, data?: D, config?: AxiosRequestConfig): Promise; } export declare class SmartRentWebsocketClient extends SmartRentApiClient { readonly platform: SmartRentPlatform; wsClient: Promise; event: Object; private devices; constructor(platform: SmartRentPlatform); private _emitize; /** * Initialize WebSocket client for SmartRent API * @returns WebSocket client */ private _initializeWsClient; private _handleWsOpen; private _handleWsMessage; private _handleWsError; private _handleWsClose; /** * Adds device to websocket client subsciption list and announces events to device handlers * @param deviceId Device ID */ subscribeDevice(deviceId: Number): Promise; } //# sourceMappingURL=client.d.ts.map