mirror of https://github.com/Hypfer/Valetudo.git
49 lines
1.6 KiB
JavaScript
49 lines
1.6 KiB
JavaScript
const capabilities = require("./capabilities");
|
|
const MiioValetudoRobot = require("../MiioValetudoRobot");
|
|
const QuirksCapability = require("../../core/capabilities/QuirksCapability");
|
|
const RoborockGen4ValetudoRobot = require("./RoborockGen4ValetudoRobot");
|
|
const RoborockQuirkFactory = require("./RoborockQuirkFactory");
|
|
const RoborockValetudoRobot = require("./RoborockValetudoRobot");
|
|
|
|
class RoborockS4MaxValetudoRobot extends RoborockGen4ValetudoRobot {
|
|
/**
|
|
*
|
|
* @param {object} options
|
|
* @param {import("../../Configuration")} options.config
|
|
* @param {import("../../ValetudoEventStore")} options.valetudoEventStore
|
|
*/
|
|
constructor(options) {
|
|
super(options);
|
|
|
|
[
|
|
capabilities.RoborockCombinedVirtualRestrictionsCapability
|
|
].forEach(capability => {
|
|
this.registerCapability(new capability({robot: this}));
|
|
});
|
|
|
|
const quirkFactory = new RoborockQuirkFactory({
|
|
robot: this
|
|
});
|
|
this.registerCapability(new QuirksCapability({
|
|
robot: this,
|
|
quirks: [
|
|
quirkFactory.getQuirk(RoborockQuirkFactory.KNOWN_QUIRKS.BUTTON_LEDS),
|
|
quirkFactory.getQuirk(RoborockQuirkFactory.KNOWN_QUIRKS.MANUAL_MAP_SEGMENT_TRIGGER)
|
|
]
|
|
}));
|
|
}
|
|
getModelName() {
|
|
return "S4 Max";
|
|
}
|
|
|
|
static IMPLEMENTATION_AUTO_DETECTION_HANDLER() {
|
|
const deviceConf = MiioValetudoRobot.READ_DEVICE_CONF(RoborockValetudoRobot.DEVICE_CONF_PATH);
|
|
|
|
return !!(deviceConf && deviceConf.model === "roborock.vacuum.a19");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
module.exports = RoborockS4MaxValetudoRobot;
|