UNPKG

hottohts

Version:

TypeScript library for HottoH pellet stoves

75 lines 2.06 kB
/** * Low-level TCP client for HottoH stoves. Handles protocol communication and polling. * Not intended for direct use; use the Hottoh class for most applications. */ export declare class HottohRemoteClient { private address; private port; private _info; private _data; private _data2; private _raw; private _writeRequest; private _writeParameters; private _disconnectRequest; private _socket; private __isConnected; private __endRequest; private _responseBuffer; private _pendingResponse; private _loopTimeout; private _eventHandlers; constructor(address?: string, port?: number, id?: number); /** * Set up persistent event handlers for the socket * These handlers remain throughout the lifecycle of the client */ private _setupSocketEventHandlers; /** * Clean up and reset the socket */ private _resetSocket; /** * Connect to the stove over TCP. * @returns Promise that resolves when connected. */ connect(): Promise<void>; /** * Check if the stove is reachable and protocol is working. * @returns Promise<boolean> */ check(): Promise<boolean>; /** * Returns true if the TCP socket is connected. */ isConnected(): boolean; private _extractData; private _sendRequestAndWaitForResponse; private _get_data; private _set_data; private _set_raw; /** * Send a command to the stove (queued for next poll cycle). * @param parameters Command parameters as string array * @returns true if queued */ sendCommand(parameters: string[]): boolean; /** * Start polling the stove for data. */ start(): void; /** * Stop polling and disconnect. */ stop(): void; private loop; private __connect; private __dial; private __disconnect; /** * Clean up all resources * Call this when done with the client to prevent memory leaks */ dispose(): void; } //# sourceMappingURL=client.d.ts.map