Valetudo/backend/lib/robots/dreame/DreameW10ValetudoRobot.js

49 lines
1.7 KiB
JavaScript

const DreameCarpetSensorModeControlCapability = require("./capabilities/DreameCarpetSensorModeControlCapability");
const DreameMopValetudoRobot = require("./DreameMopValetudoRobot");
const DreameQuirkFactory = require("./DreameQuirkFactory");
const DreameValetudoRobot = require("./DreameValetudoRobot");
const MiioValetudoRobot = require("../MiioValetudoRobot");
const QuirksCapability = require("../../core/capabilities/QuirksCapability");
class DreameW10ValetudoRobot extends DreameMopValetudoRobot {
/**
*
* @param {object} options
* @param {import("../../Configuration")} options.config
* @param {import("../../ValetudoEventStore")} options.valetudoEventStore
*/
constructor(options) {
super(options);
const QuirkFactory = new DreameQuirkFactory({
robot: this
});
this.registerCapability(new DreameCarpetSensorModeControlCapability({
robot: this
}));
this.registerCapability(new QuirksCapability({
robot: this,
quirks: [
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.MOP_DOCK_MOP_ONLY_MODE),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.MOP_DOCK_MOP_CLEANING_FREQUENCY),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.MOP_DOCK_WET_DRY_SWITCH),
]
}));
}
getModelName() {
return "W10";
}
static IMPLEMENTATION_AUTO_DETECTION_HANDLER() {
const deviceConf = MiioValetudoRobot.READ_DEVICE_CONF(DreameValetudoRobot.DEVICE_CONF_PATH);
return !!(deviceConf && deviceConf.model === "dreame.vacuum.p2027");
}
}
module.exports = DreameW10ValetudoRobot;