UNPKG

matterbridge-roborock-vacuum-plugin

Version:
36 lines 1.94 kB
import { RvcOperationalState, RvcRunMode } from 'matterbridge/matter/clusters'; import { StatusChangeMessage } from '../roborockCommunication/models/deviceStatus.js'; export interface ResolvedState { runMode: RvcRunMode.ModeTag; operationalState: RvcOperationalState.OperationalState; } /** * Resolves the robot's state based on status code and modifier flags. * * Implements a 48-row state resolution matrix with three priority levels: * * 1. **Status Override Rules** (Highest Priority) * - Certain status codes ignore ALL modifier flags * - Examples: Sleeping (2), Idle (3), InError (12), WashingTheMop (23), GoingToWashTheMop (26), etc. * - Sleeping (2): inCleaning=true → Cleaning+Paused; isExploring=true → Mapping+Paused; base → Idle+Paused * * 2. **Cleaning Status Special Overrides** * - When status = 5 (Cleaning), modifiers apply in explicit priority order: * a. isLocating/isExploring (Highest) - Sets UpdatingMaps operational state * b. inWarmup (Second) - Sets CleaningMop operational state * c. inReturning (Third) - Sets SeekingCharger operational state * d. inFreshState (N/A) - Not applicable to Cleaning status * * 3. **Modifier Priority Chain** * - For all other cases, modifiers apply in priority order: * a. inReturning (High) - Sets SeekingCharger operational state (ignored for Paused, ReturnToDock, ReturningDock) * b. isExploring (Medium) - Changes run mode to Mapping (blocked on Charging) * c. inFreshState (Low) - No longer used (redundant with Charging base state) * * @param message StatusChangeMessage containing status code and modifier flags * @returns ResolvedState with runMode and operationalState * * @see misc/state_resolution_matrix.md - Complete 47-row matrix documentation */ export declare function resolveDeviceState(message: StatusChangeMessage): ResolvedState; //# sourceMappingURL=stateResolver.d.ts.map