lib-comfoair
Version:
Library to communicate with Zehnder ComfoAirQ ventilation unit through the ComfoControl gateway
29 lines (28 loc) • 1.2 kB
TypeScript
import { GatewayOperation, Opcode, Result } from './protocol/comfoConnect';
import { opcodes } from './opcodes';
import { BinaryReadOptions } from '@protobuf-ts/runtime';
/**
* Describes the header of the ComfoAir messages, each message starts with this header.
* The header is always 38 bytes long.
*/
export declare class ComfoControlMessage<T extends keyof typeof opcodes = Opcode.NO_OPERATION> {
private operation;
private message;
get opcode(): Opcode;
get opcodeName(): string;
get id(): number;
get resultCode(): Result;
get resultName(): string;
constructor(operation: GatewayOperation, message: Uint8Array);
static fromJson<D extends keyof typeof opcodes>(operation: GatewayOperation & {
opcode: D;
}, message?: ReturnType<(typeof opcodes)[D]['create']>): ComfoControlMessage;
static fromBinary(data: Buffer): Array<ComfoControlMessage>;
toString(): string;
deserialize<D extends keyof typeof opcodes = T>(options?: Partial<BinaryReadOptions>): ReturnType<(typeof opcodes)[D]['create']>;
/**
* Returns the message as a untyped JSON object.
* @returns The message as a JSON object.
*/
toJson(): object;
}