mirror of https://github.com/Hypfer/Valetudo.git
46 lines
1.5 KiB
JavaScript
46 lines
1.5 KiB
JavaScript
const capabilities = require("./capabilities");
|
|
const MiioValetudoRobot = require("../MiioValetudoRobot");
|
|
const QuirksCapability = require("../../core/capabilities/QuirksCapability");
|
|
const ViomiQuirkFactory = require("./ViomiQuirkFactory");
|
|
const ViomiValetudoRobot = require("./ViomiValetudoRobot");
|
|
|
|
|
|
class ViomiV8ValetudoRobot extends ViomiValetudoRobot {
|
|
/**
|
|
* @param {object} options
|
|
* @param {import("../../Configuration")} options.config
|
|
* @param {import("../../ValetudoEventStore")} options.valetudoEventStore
|
|
* @param {object} [options.fanSpeeds]
|
|
* @param {object} [options.waterGrades]
|
|
*/
|
|
constructor(options) {
|
|
super(options);
|
|
|
|
this.registerCapability(new capabilities.ViomiVoicePackManagementCapability({
|
|
robot: this
|
|
}));
|
|
|
|
const quirkFactory = new ViomiQuirkFactory({
|
|
robot: this
|
|
});
|
|
this.registerCapability(new QuirksCapability({
|
|
robot: this,
|
|
quirks: [
|
|
quirkFactory.getQuirk(ViomiQuirkFactory.KNOWN_QUIRKS.BUTTON_LEDS),
|
|
quirkFactory.getQuirk(ViomiQuirkFactory.KNOWN_QUIRKS.OUTLINE_MODE),
|
|
]
|
|
}));
|
|
}
|
|
|
|
getModelName() {
|
|
return "V8";
|
|
}
|
|
|
|
static IMPLEMENTATION_AUTO_DETECTION_HANDLER() {
|
|
const deviceConf = MiioValetudoRobot.READ_DEVICE_CONF(ViomiValetudoRobot.DEVICE_CONF_PATH);
|
|
return !!(deviceConf && ["viomi.vacuum.v8", "viomi.vacuum.v9"].includes(deviceConf.model));
|
|
}
|
|
}
|
|
|
|
module.exports = ViomiV8ValetudoRobot;
|