Skip to content

Commit

Permalink
fix(vendor.dreame): Fix water hookup test quirk success state raising…
Browse files Browse the repository at this point in the history
… an error
  • Loading branch information
Hypfer committed Nov 2, 2024
1 parent 86e58df commit 74731a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 3 additions & 1 deletion backend/lib/robots/dreame/DreameConst.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ const WATER_HOOKUP_ERRORS = Object.freeze({
2: "External control box not installed",
3: "Freshwater input abnormal. Check anything affecting water pressure",
4: "Wastewater output abnormal. Check the pump",
5: "Wastewater output abnormal. Check the filter"
5: "Wastewater output abnormal. Check the filter",
// 6 is success
7: "Pump failure" // No clue which pump, but some pump for sure has failed. "MOTOR_PERISTALTIC_TEST_FAIL"
});

module.exports = {
Expand Down
20 changes: 13 additions & 7 deletions backend/lib/robots/dreame/DreameGen2ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,14 @@ class DreameGen2ValetudoRobot extends DreameValetudoRobot {
}

if (deserializedTunables.FluctuationConfirmResult > 0) {
const errorString = DreameConst.WATER_HOOKUP_ERRORS[deserializedTunables.FluctuationTestResult];
this.valetudoEventStore.raise(new ErrorStateValetudoEvent({
message: `Water Hookup Error. ${errorString ?? "Unknown error " + deserializedTunables.FluctuationTestResult}`
}));
if (deserializedTunables.FluctuationTestResult !== 6) { // 6 Means success
const errorString = DreameConst.WATER_HOOKUP_ERRORS[deserializedTunables.FluctuationTestResult];

this.valetudoEventStore.raise(new ErrorStateValetudoEvent({
message: `Water Hookup Error. ${errorString ?? "Unknown error " + deserializedTunables.FluctuationTestResult}`
}));
}


this.helper.writeProperty(
DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
Expand Down Expand Up @@ -692,7 +696,7 @@ class DreameGen2ValetudoRobot extends DreameValetudoRobot {
if (this.errorCode.includes(",")) {
let errorArray = this.errorCode.split(",");

errorArray = errorArray.filter(e => !["68", "114"].includes(e));
errorArray = errorArray.filter(e => !["68", "114", "122"].includes(e));

this.errorCode = errorArray[0] ?? "";
}
Expand All @@ -709,13 +713,15 @@ class DreameGen2ValetudoRobot extends DreameValetudoRobot {
statusValue = stateAttrs.StatusStateAttribute.VALUE.DOCKED;
}
} else {
if (this.errorCode === "68") { //Docked with mop still attached. For some reason, dreame decided to have this as an error
if (this.errorCode === "68") { // Docked with mop still attached. For some reason, dreame decided to have this as an error
statusValue = stateAttrs.StatusStateAttribute.VALUE.DOCKED;

if (!this.hasCapability(capabilities.DreameMopDockDryManualTriggerCapability.TYPE)) {
this.valetudoEventStore.raise(new MopAttachmentReminderValetudoEvent({}));
}
} else if (this.errorCode === "114") { //Reminder message to regularly clean the mop dock
} else if (this.errorCode === "114") { // Reminder message to regularly clean the mop dock
statusValue = stateAttrs.StatusStateAttribute.VALUE.DOCKED;
} else if (this.errorCode === "122") { // Apparently just an info that the water hookup (kit) worked successfully?
statusValue = stateAttrs.StatusStateAttribute.VALUE.DOCKED;
} else {
statusValue = stateAttrs.StatusStateAttribute.VALUE.ERROR;
Expand Down

0 comments on commit 74731a6

Please sign in to comment.