-
-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vacuum.roborock): Re-added support for S6 Pure
- Loading branch information
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const RoborockValetudoRobot = require("./RoborockValetudoRobot"); | ||
const MiioValetudoRobot = require("../MiioValetudoRobot"); | ||
const capabilities = require("./capabilities"); | ||
const entities = require("../../entities"); | ||
|
||
class RoborockS6PureValetudoRobot extends RoborockValetudoRobot { | ||
/** | ||
* | ||
* @param {object} options | ||
* @param {import("../../Configuration")} options.config | ||
*/ | ||
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.RoborockMultiMapPersistentMapControlCapability({ | ||
robot: this | ||
})); | ||
this.registerCapability(new capabilities.RoborockMapSegmentationCapability({ | ||
robot: this | ||
})); | ||
} | ||
|
||
getModelName() { | ||
return "S6 Pure"; | ||
} | ||
|
||
static IMPLEMENTATION_AUTO_DETECTION_HANDLER() { | ||
const deviceConf = MiioValetudoRobot.READ_DEVICE_CONF(RoborockValetudoRobot.DEVICE_CONF_PATH); | ||
|
||
return !!(deviceConf && (deviceConf.model === "roborock.vacuum.a08" || deviceConf.model === "roborock.vacuum.p5")); | ||
} | ||
} | ||
|
||
const FAN_SPEEDS = { | ||
[entities.state.attributes.IntensityStateAttribute.VALUE.LOW]: 101, | ||
[entities.state.attributes.IntensityStateAttribute.VALUE.MEDIUM]: 102, | ||
[entities.state.attributes.IntensityStateAttribute.VALUE.HIGH]: 103, | ||
[entities.state.attributes.IntensityStateAttribute.VALUE.MAX]: 104, | ||
[entities.state.attributes.IntensityStateAttribute.VALUE.OFF] : 105 //also known as mop mode | ||
}; | ||
|
||
module.exports = RoborockS6PureValetudoRobot; |