mirror of
https://github.com/Hypfer/Valetudo.git
synced 2025-10-26 11:27:27 +00:00
feat(vendor.roborock): Add support for the M1S
This commit is contained in:
parent
9c123bd039
commit
f234925aef
60
backend/lib/robots/roborock/RoborockM1SValetudoRobot.js
Normal file
60
backend/lib/robots/roborock/RoborockM1SValetudoRobot.js
Normal file
@ -0,0 +1,60 @@
|
||||
const capabilities = require("./capabilities");
|
||||
const entities = require("../../entities");
|
||||
const MiioValetudoRobot = require("../MiioValetudoRobot");
|
||||
const RoborockValetudoRobot = require("./RoborockValetudoRobot");
|
||||
|
||||
|
||||
class RoborockM1SValetudoRobot extends RoborockValetudoRobot {
|
||||
/**
|
||||
*
|
||||
* @param {object} options
|
||||
* @param {import("../../Configuration")} options.config
|
||||
* @param {import("../../ValetudoEventStore")} options.valetudoEventStore
|
||||
*/
|
||||
constructor(options) {
|
||||
super(Object.assign({}, options, {fanSpeeds: FAN_SPEEDS}));
|
||||
|
||||
this.registerCapability(new capabilities.RoborockMapSnapshotCapability({
|
||||
robot: this
|
||||
}));
|
||||
this.registerCapability(new capabilities.RoborockCombinedVirtualRestrictionsCapability({
|
||||
robot: this
|
||||
}));
|
||||
this.registerCapability(new capabilities.RoborockPersistentMapControlCapability({
|
||||
robot: this
|
||||
}));
|
||||
this.registerCapability(new capabilities.RoborockMapResetCapability({
|
||||
robot: this
|
||||
}));
|
||||
this.registerCapability(new capabilities.RoborockMapSegmentationCapability({
|
||||
robot: this
|
||||
}));
|
||||
this.registerCapability(new capabilities.RoborockMapSegmentEditCapability({
|
||||
robot: this
|
||||
}));
|
||||
this.registerCapability(new capabilities.RoborockMapSegmentRenameCapability({
|
||||
robot: this
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
getModelName() {
|
||||
return "M1S";
|
||||
}
|
||||
|
||||
static IMPLEMENTATION_AUTO_DETECTION_HANDLER() {
|
||||
const deviceConf = MiioValetudoRobot.READ_DEVICE_CONF(RoborockValetudoRobot.DEVICE_CONF_PATH);
|
||||
|
||||
return !!(deviceConf && deviceConf.model === "roborock.vacuum.m1s");
|
||||
}
|
||||
}
|
||||
|
||||
const FAN_SPEEDS = {
|
||||
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.MIN]: 1,
|
||||
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.LOW]: 38,
|
||||
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.MEDIUM]: 60,
|
||||
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.HIGH]: 75,
|
||||
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.MAX]: 100
|
||||
};
|
||||
|
||||
module.exports = RoborockM1SValetudoRobot;
|
||||
@ -1,4 +1,5 @@
|
||||
module.exports = {
|
||||
"RoborockM1SValetudoRobot": require("./RoborockM1SValetudoRobot"),
|
||||
"RoborockS4MaxValetudoRobot": require("./RoborockS4MaxValetudoRobot"),
|
||||
"RoborockS4ValetudoRobot": require("./RoborockS4ValetudoRobot"),
|
||||
"RoborockS5MaxValetudoRobot": require("./RoborockS5MaxValetudoRobot"),
|
||||
|
||||
@ -258,6 +258,7 @@ function getModelDescription(vendor, model) {
|
||||
* @type {string[]}
|
||||
*/
|
||||
const HIDDEN_IMPLEMENTATIONS = [
|
||||
"RoborockM1SValetudoRobot",
|
||||
"RoborockS6MaxVValetudoRobot",
|
||||
"RoborockS7ValetudoRobot",
|
||||
"DreameSTYTJO6ZHMValetudoRobot"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user