Skip to content

Commit

Permalink
feat(vendor.dreame): Add drain internal water tank quirk
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Jan 26, 2024
1 parent 7ebb34f commit 25f428f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/lib/robots/dreame/DreameL10SUltraValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class DreameL10SUltraValetudoRobot extends DreameGen2LidarValetudoRobot {
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.MOP_DOCK_AUTO_REPAIR_TRIGGER),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.MOP_DOCK_AUTO_DRYING),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.EDGE_MOPPING),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.DRAIN_INTERNAL_WATER_TANK),
]
}));

Expand Down
1 change: 1 addition & 0 deletions backend/lib/robots/dreame/DreameL10UltraValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class DreameL10UltraValetudoRobot extends DreameGen2LidarValetudoRobot {
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.MOP_DOCK_AUTO_REPAIR_TRIGGER),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.MOP_DOCK_AUTO_DRYING),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.EDGE_MOPPING),
QuirkFactory.getQuirk(DreameQuirkFactory.KNOWN_QUIRKS.DRAIN_INTERNAL_WATER_TANK),
]
}));

Expand Down
28 changes: 27 additions & 1 deletion backend/lib/robots/dreame/DreameQuirkFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,31 @@ class DreameQuirkFactory {
);
}
});
case DreameQuirkFactory.KNOWN_QUIRKS.DRAIN_INTERNAL_WATER_TANK:
return new Quirk({
id: id,
title: "Drain internal water tank",
description: "Drain the internal water tank of the robot into the dock. " +
"This can be useful if the robot is to be transported or stored for a while. May take up to 3 minutes.",
options: ["select_to_trigger", "trigger"],
getter: async () => {
return "select_to_trigger";
},
setter: async (value) => {
if (value === "trigger") {
await this.helper.executeAction(
DreameMiotServices["GEN2"].VACUUM_2.SIID,
DreameMiotServices["GEN2"].VACUUM_2.ACTIONS.MOP_DOCK_INTERACT.AIID,
[
{
piid: DreameMiotServices["GEN2"].VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID,
value: "7,1"
}
]
);
}
}
});
default:
throw new Error(`There's no quirk with id ${id}`);
}
Expand All @@ -599,7 +624,8 @@ DreameQuirkFactory.KNOWN_QUIRKS = {
MOP_DOCK_WET_DRY_SWITCH: "66adac0f-0a16-4049-b6ac-080ef702bb39",
MOP_DOCK_AUTO_REPAIR_TRIGGER: "ae753798-aa4f-4b35-a60c-91e7e5ae76f3",
MOP_DOCK_AUTO_DRYING: "6efc4d62-b5a4-474e-b353-5746a99ee8f9",
EDGE_MOPPING: "7c71db1b-72b6-402e-89a4-d66c72cb9c8c"
EDGE_MOPPING: "7c71db1b-72b6-402e-89a4-d66c72cb9c8c",
DRAIN_INTERNAL_WATER_TANK: "3e1b0851-3a5a-4943-bea6-dea3d7284bff"
};

module.exports = DreameQuirkFactory;

0 comments on commit 25f428f

Please sign in to comment.