Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vendor.dreame): D9 Pro+ special edition support
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const DreameD9ValetudoRobot = require("./DreameD9ValetudoRobot"); | ||
const DreameValetudoRobot = require("./DreameValetudoRobot"); | ||
const fs = require("fs"); | ||
const MiioValetudoRobot = require("../MiioValetudoRobot"); | ||
|
||
/** | ||
* There is no such thing as a D9 Pro+ | ||
* This implementation is used by D9 Pros that use a backported D9 firmware | ||
*/ | ||
class DreameD9ProPlusValetudoRobot extends DreameD9ValetudoRobot { | ||
/** | ||
* | ||
* @param {object} options | ||
* @param {import("../../Configuration")} options.config | ||
* @param {import("../../ValetudoEventStore")} options.valetudoEventStore | ||
*/ | ||
constructor(options) { | ||
super(options); | ||
} | ||
|
||
getModelName() { | ||
return "D9 Pro+"; | ||
} | ||
|
||
static IMPLEMENTATION_AUTO_DETECTION_HANDLER() { | ||
const deviceConf = MiioValetudoRobot.READ_DEVICE_CONF(DreameValetudoRobot.DEVICE_CONF_PATH); | ||
const isD9Pro = !!(deviceConf && deviceConf.model === "dreame.vacuum.p2187"); | ||
|
||
return isD9Pro && fs.existsSync("/etc/dustbuilder_backport"); | ||
} | ||
} | ||
|
||
|
||
module.exports = DreameD9ProPlusValetudoRobot; |
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