homebridge-homeconnect
Version:
A Homebridge plugin that connects Home Connect appliances to Apple HomeKit
67 lines • 3.73 kB
TypeScript
import { Logger } from 'homebridge';
import { HomeAppliance } from '../api-types.js';
import { CommandKV, CommandKey, EventApplianceConnectionEvent, EventApplianceDataEvent, EventDataKV, EventKV, EventKey, EventMapKey, EventValue, OptionKV, OptionKey, OptionValue, ProgramDefinitionKV, ProgramKV, ProgramsKV, SettingKV, SettingKey, SettingValue, StatusKV, StatusKey, StatusValue } from '../api-value.js';
import { OperationState, ProgramKey } from '../api-value-types.js';
import { APIStatusCodeError } from '../api-errors.js';
export type MockEvent<Event extends EventMapKey = EventMapKey, Key extends EventKey<Event> = EventKey<Event>> = [
Event,
Key,
EventValue<Key, Event>
];
export type DataEventQueue = {
[Event in EventApplianceDataEvent]: EventDataKV<Event>[];
};
export declare abstract class MockAppliance {
readonly log: Logger;
abstract readonly type: string;
abstract readonly enumber: string;
readonly brand: string;
readonly name?: string;
readonly status: StatusKV[];
readonly settings: SettingKV[];
readonly commands: CommandKV[];
readonly programs: ProgramDefinitionKV[];
connected: boolean;
program?: ProgramKV;
readonly dataEventQueue: DataEventQueue;
emitEventPromise: Promise<EventKV>;
emitEventResolve: (event: EventKV) => void;
constructor(log: Logger);
get vib(): string;
get haid(): string;
getAppliance(): HomeAppliance;
getPrograms(): ProgramsKV;
getAvailablePrograms(): ProgramsKV;
getAvailableProgram<PKey extends ProgramKey>(key: PKey): ProgramDefinitionKV<PKey>;
getActiveProgram(): ProgramKV;
setActiveProgram(key: ProgramKey, options?: OptionKV[]): void;
stopActiveProgram(): void;
getActiveProgramOptions(): OptionKV[];
setActiveProgramOptions(options: OptionKV[]): void;
getActiveProgramOption<Key extends OptionKey>(key: Key): OptionKV<Key>;
setActiveProgramOption<Key extends OptionKey>(key: Key, value: OptionValue<Key>): void;
getSelectedProgram(): ProgramKV;
setSelectedProgram(key: ProgramKey, options: OptionKV[]): void;
getSelectedProgramOptions(): OptionKV[];
setSelectedProgramOptions(options: OptionKV[]): void;
getSelectedProgramOption<Key extends OptionKey>(key: Key): OptionKV<Key>;
setSelectedProgramOption<Key extends OptionKey>(key: Key, value: OptionValue<Key>): void;
setProgramWithDefaultOptions(key: ProgramKey, options?: OptionKV[]): void;
getStatus(): StatusKV[];
getStatusSpecific<Key extends StatusKey>(key: Key): StatusKV<Key>;
setStatus<Key extends StatusKey>(key: Key, value: StatusValue<Key>): void;
getSettings(): SettingKV[];
getSetting<Key extends SettingKey>(key: Key): SettingKV<Key>;
setSetting<Key extends SettingKey>(key: Key, value: SettingValue<Key>): void;
getCommands(): CommandKV[];
setCommand(key: CommandKey): void;
emitConnectedEvent(event: EventApplianceConnectionEvent): void;
emitNotifyEvent<Key extends OptionKey | SettingKey | EventKey<'NOTIFY'>>(key: Key, value: OptionValue<Key> | SettingValue<Key> | EventValue<Key>): void;
emitStatusEvent<Key extends StatusKey>(key: Key, value: StatusValue<Key>): void;
emitEventEvent<Key extends EventKey<'EVENT'>>(key: Key, value: EventValue<Key>): void;
emitDataEvent<Event extends EventApplianceDataEvent, Key extends EventKey<Event> = EventKey<Event>>(event: Event, key: Key, value: EventValue<Key, Event>): void;
getEvents(): AsyncGenerator<EventKV, void, void>;
isOperationState(...states: (keyof typeof OperationState)[]): boolean;
static statusCodeError(statusCode: number, errorKey: string, itemKey?: string): APIStatusCodeError;
}
//# sourceMappingURL=mock-appliance.d.ts.map