matterbridge-roborock-vacuum-plugin
Version:
Matterbridge Roborock Vacuum Plugin
54 lines • 1.47 kB
JavaScript
import { DockInfo } from './dockInfo.js';
import { VacuumError } from './vacuumError.js';
export class StatusChangeMessage {
duid;
status;
inCleaning;
inReturning;
inFreshState;
isLocating;
isExploring;
inWarmup;
constructor(duid, status, inCleaning, inReturning, inFreshState, isLocating, isExploring, inWarmup) {
this.duid = duid;
this.status = status;
this.inCleaning = inCleaning;
this.inReturning = inReturning;
this.inFreshState = inFreshState;
this.isLocating = isLocating;
this.isExploring = isExploring;
this.inWarmup = inWarmup;
}
}
export class DeviceStatus {
duid;
message;
errorStatus;
constructor(duid, message) {
this.duid = duid;
this.message = message;
this.errorStatus = new VacuumError(this.duid, this.message.error_code, this.message.dock_error_status, this.message.dss);
}
getMessage() {
return this.message;
}
getBattery() {
return this.message.battery;
}
getChargeStatus() {
return this.message.charge_status;
}
getVacuumErrorCode() {
return this.message.error_code;
}
getDockInfo() {
return new DockInfo(this.message.dock_type);
}
getDockErrorCode() {
return this.message.dock_error_status;
}
getDockStationStatus() {
return this.message.dss;
}
}
//# sourceMappingURL=deviceStatus.js.map