@ljames8/hormann-hcp-client
Version:
Hormann Communication Protocol v1 garage door serial client
21 lines (20 loc) • 1.35 kB
TypeScript
import { EventEmitter } from "node:events";
import { CurrentDoorState, GarageState } from "./garageDoor";
import { HCPClient, STATUS_RESPONSE_BYTE0_BITFIELD } from "./serialHCPClient";
import { HCPPacket } from "./parser";
export declare class MockHCPClient extends EventEmitter implements HCPClient {
pushCommandMock: (flags: STATUS_RESPONSE_BYTE0_BITFIELD[], emergencyStop: boolean) => Promise<HCPPacket>;
readonly listenOnly: boolean;
mockState: GarageState;
constructor(pushCommandMock?: (flags: STATUS_RESPONSE_BYTE0_BITFIELD[], emergencyStop: boolean) => Promise<HCPPacket>, listenOnly?: boolean);
inferPushCommandMock(flags: STATUS_RESPONSE_BYTE0_BITFIELD[], emergencyStop: boolean): Promise<HCPPacket>;
pushCommand(flags: STATUS_RESPONSE_BYTE0_BITFIELD[], emergencyStop?: boolean): Promise<HCPPacket>;
static doorStateToBroadcastStatusByte(state: CurrentDoorState): number;
static lightStateToBroadcastStatusByte(state: boolean): number;
static garageStateToBroadcastStatus(state: GarageState): Uint8Array;
static responseStatusToNextState(flags: STATUS_RESPONSE_BYTE0_BITFIELD[], currentState: GarageState): GarageState;
emitGarageState(state: GarageState): boolean;
emitDoorError(): boolean;
emitDoorState(state: CurrentDoorState): boolean;
emitLightState(state: boolean): boolean;
}