Skip to content

Commit

Permalink
feat(vendor.roborock): new fan speed and mop patterns for Gen4 robots
Browse files Browse the repository at this point in the history
Signed-off-by: Xuefer <[email protected]>
  • Loading branch information
Xuefer committed Mar 31, 2024
1 parent 53453f9 commit 7f88247
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/lib/robots/roborock/RoborockGen4ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ const FAN_SPEEDS = {
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.MEDIUM]: 102,
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.HIGH]: 103,
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.MAX]: 104,
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.TURBO]: 108,
[entities.state.attributes.PresetSelectionStateAttribute.INTENSITY.OFF] : 105 //also known as mop mode
};

Expand Down
17 changes: 16 additions & 1 deletion backend/lib/robots/roborock/RoborockQuirkFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class RoborockQuirkFactory {
id: id,
title: "Mop Pattern",
description: "Select which movement mode to use while mopping.",
options: ["standard", "deep"],
options: ["fast", "standard", "deep", "deep+", "customize"],
getter: async () => {
const res = await this.robot.sendCommand("get_mop_mode", [], {});

Expand All @@ -268,6 +268,12 @@ class RoborockQuirkFactory {
return "standard";
case 301:
return "deep";
case 302:
return "customize";
case 303:
return "deep+";
case 304:
return "fast";
default:
throw new Error(`Received invalid value ${res?.[0]}`);
}
Expand All @@ -282,6 +288,15 @@ class RoborockQuirkFactory {
case "deep":
val = 301;
break;
case "customize":
val = 302;
break;
case "deep+":
val = 303;
break;
case "fast":
val = 304;
break;
default:
throw new Error(`Received invalid value ${value}`);
}
Expand Down

0 comments on commit 7f88247

Please sign in to comment.