homebridge-aeg-robot
Version:
AEG RX9 / Electrolux Pure i9 robot vacuum plugin for Homebridge
89 lines • 3.53 kB
TypeScript
import { Logger } from 'homebridge';
import { EventEmitter } from 'events';
import { AEGAccount } from './aeg-account.js';
import { Config } from './config-types.js';
import { RX9ApplianceInfo, RX9ApplianceState, RX9BatteryStatus, RX9Capabilities, RX9CleaningCommand, RX9Dustbin, RX9Message, RX92PowerMode, RX9RobotStatus } from './aegapi-rx9-types.js';
import { AEGAPIRX9 } from './aegapi-rx9.js';
import { Appliance } from './aegapi-types.js';
export declare enum SimpleActivity {
Other = "Other",
Clean = "Clean",
Pitstop = "Pitstop",
Pause = "Pause",
Return = "Return"
}
export interface DynamicStatus {
hardware: string;
firmware: string;
capabilities: RX9Capabilities[];
battery?: RX9BatteryStatus;
activity?: RX9RobotStatus;
dustbin?: RX9Dustbin;
rawPower?: RX92PowerMode;
rawEco?: boolean;
enabled: boolean;
connected: boolean;
isServerError?: unknown;
isRobotError?: unknown;
simpleActivity?: SimpleActivity;
isBatteryLow?: boolean;
isCharging?: boolean;
isDustbinEmpty?: boolean;
isDocked?: boolean;
isActive?: boolean;
isBusy?: boolean;
isFault?: boolean;
isError?: unknown;
power?: RX92PowerMode;
eco?: boolean;
}
export type StatusEvent = keyof DynamicStatus;
interface DataEventType {
message: RX9Message;
}
type DataEvent = keyof DataEventType;
type VoidEvent = 'info' | 'appliance' | 'preUpdate';
type DataEventListener<Event extends DataEvent> = (value: DataEventType[Event]) => void;
type StatusEventListener<Event extends StatusEvent> = (newValue: DynamicStatus[Event], oldValue: DynamicStatus[Event]) => void;
export declare class AEGRobot extends EventEmitter {
readonly account: AEGAccount;
readonly appliance: Appliance;
readonly config: Config;
readonly log: Logger;
readonly api: AEGAPIRX9;
readonly setActivity: (command: RX9CleaningCommand) => void;
readonly applianceId: string;
pnc: string;
sn: string;
brand: string;
model: string;
name: string;
readonly status: DynamicStatus;
private emittedStatus;
private readonly emittedMessages;
private readonly readyPromise;
constructor(log: Logger, account: AEGAccount, appliance: Appliance);
waitUntilReady(): Promise<this>;
init(): Promise<void>;
toString(): string;
updateFromApplianceInfo(info: RX9ApplianceInfo): void;
updateFromApplianceState(state: RX9ApplianceState): void;
pollApplianceState(): Promise<void>;
heartbeat(err?: unknown): void;
updateDerivedAndEmit(): void;
updateDerived(): void;
updateStatus(update: Partial<DynamicStatus>): void;
emitChangeEvents(): void;
emitMessages(messages?: RX9Message[]): void;
on(event: VoidEvent, listener: () => void): this;
on<Event extends DataEvent>(event: Event, dataListener: DataEventListener<Event>): this;
on<Event extends StatusEvent>(event: Event, statusListener: StatusEventListener<Event>): this;
once(event: VoidEvent, listener: () => void): this;
once<Event extends DataEvent>(event: Event, dataListener: DataEventListener<Event>): this;
once<Event extends StatusEvent>(event: Event, statusListener: StatusEventListener<Event>): this;
emit(event: VoidEvent): boolean;
emit<Event extends DataEvent>(event: Event, value: DataEventType[Event]): boolean;
emit<Event extends StatusEvent>(event: Event, newValue: DynamicStatus[Event], oldValue: DynamicStatus[Event]): boolean;
}
export {};
//# sourceMappingURL=aeg-robot.d.ts.map