UNPKG

matterbridge-roborock-vacuum-plugin

Version:
58 lines 3.18 kB
import { RoboticVacuumCleaner } from 'matterbridge/devices'; import { AnsiLogger } from 'matterbridge/logger'; import { RvcCleanMode, ServiceArea } from 'matterbridge/matter/clusters'; import { CleanModeSetting } from '../behaviors/roborock.vacuum/core/CleanModeSetting.js'; import { HomeEntity } from '../core/domain/entities/Home.js'; import { DockStationStatus } from '../model/DockStationStatus.js'; import { PlatformConfigManager } from '../platform/platformConfigManager.js'; import { Device } from '../roborockCommunication/models/index.js'; import { RoborockService } from '../services/roborockService.js'; import { BehaviorFactoryResult } from '../share/behaviorFactory.js'; export declare class RoborockVacuumCleaner extends RoboticVacuumCleaner { readonly device: Device; readonly homeInFo: HomeEntity; readonly roborockService: RoborockService; dockStationStatus: DockStationStatus | undefined; cleanModeSetting: CleanModeSetting | undefined; lastUpdateAt: number | null; operationSessionStartMs: number | null; operationPausedSinceMs: number | null; operationPausedAccumMs: number; skipAreaHandler?: (skippedArea: number) => Promise<void>; /** * Create a new Roborock Vacuum Cleaner device. * Initializes the device with supported cleaning modes, run modes, areas, and routines. */ constructor(device: Device, homeInFo: HomeEntity, configManager: PlatformConfigManager, roborockService: RoborockService, log: AnsiLogger, resolvedAreas?: ServiceArea.Area[], resolvedMaps?: ServiceArea.Map[]); /** * Override to enable ServiceArea.Feature.ProgressReporting for per-room cleaning status. * Adds progress attribute to track area cleaning completion (Pending/Operating/Completed/Skipped). */ createDefaultServiceAreaClusterServer(supportedAreas?: ServiceArea.Area[], selectedAreas?: number[], currentArea?: number | null, supportedMaps?: ServiceArea.Map[]): this; /** * Override to enable RvcCleanMode.Feature.DirectModeChange for mode changes during active cleaning. * Allows controllers to change clean mode (e.g., suction power/water flow) without requiring idle state. */ createDefaultRvcCleanModeClusterServer(currentMode?: number, supportedModes?: RvcCleanMode.ModeOption[]): this; /** * Configure command handlers for the vacuum device. * Sets up handlers for identify, area selection, mode changes, and cleaning operations. */ configureHandler(behaviorHandler: BehaviorFactoryResult): void; /** * Initialize device configuration including modes, areas, and maps. */ private static initializeDeviceConfiguration; finalizeSkipArea(skippedArea: number): Promise<{ updatedProgress: ServiceArea.Progress[]; nextAreaId: number | null; }>; trySwitchMap(selectedAreaIds: number[]): Promise<void>; resolveAllRoomsForActiveMap(): number[]; /** * Helper method to add command handler with error handling. * Wraps handler logic in try-catch to avoid code duplication. */ private addCommandHandlerWithErrorHandling; } //# sourceMappingURL=roborockVacuumCleaner.d.ts.map