Skip to content

Commit

Permalink
fix(vendor.dreame): Newer dreames communicate the segment order diffe…
Browse files Browse the repository at this point in the history
…rently
  • Loading branch information
Hypfer committed Sep 5, 2024
1 parent 2152e20 commit 15c558a
Show file tree
Hide file tree
Showing 17 changed files with 328 additions and 23 deletions.
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameD10SPlusValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ class DreameD10SPlusValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameD10SProValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ class DreameD10SProValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameD9ProValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ class DreameD9ProValetudoRobot extends DreameGen2LidarValetudoRobot {
constructor(options) {
super(options);

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameCarpetModeControlCapability({robot: this}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameD9ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ class DreameD9ValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameCarpetModeControlCapability({robot: this}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameGen2VSlamValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ class DreameGen2VSlamValetudoRobot extends DreameGen2ValetudoRobot {
constructor(options) {
super(options);

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

//Looks like this is always enabled for LIDAR robots but a toggle for vSlam ones?
this.registerCapability(new capabilities.DreamePersistentMapControlCapability({
robot: this,
Expand Down
21 changes: 0 additions & 21 deletions backend/lib/robots/dreame/DreameGen2ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,6 @@ class DreameGen2ValetudoRobot extends DreameValetudoRobot {
aiid: MIOT_SERVICES.AUDIO.ACTIONS.LOCATE.AIID
}));

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: MIOT_SERVICES.VACUUM_2.SIID,
aiid: MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameMapSegmentEditCapability({
robot: this,
miot_actions: {
Expand Down
23 changes: 23 additions & 0 deletions backend/lib/robots/dreame/DreameGen4ValetudoRobot.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const capabilities = require("./capabilities");
const DreameGen2LidarValetudoRobot = require("./DreameGen2LidarValetudoRobot");
const DreameGen2ValetudoRobot = require("./DreameGen2ValetudoRobot");
const DreameMiotHelper = require("./DreameMiotHelper");
Expand All @@ -9,6 +10,28 @@ class DreameGen4ValetudoRobot extends DreameGen2LidarValetudoRobot {
constructor(options) {
super(options);

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true,
newCustomOrderStyle: true
}));

this.helper = new DreameMiotHelper({robot: this});
}

Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameL10ProValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,27 @@ class DreameL10ProValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameL10SProValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ class DreameL10SProValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameL10SUltraValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,27 @@ class DreameL10SUltraValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameL10UltraValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,27 @@ class DreameL10UltraValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameMopValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ class DreameMopValetudoRobot extends DreameGen2ValetudoRobot {
constructor(options) {
super(options);

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameZoneCleaningCapability({
robot: this,
miot_actions: {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameP2150ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ class DreameP2150ValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
21 changes: 21 additions & 0 deletions backend/lib/robots/dreame/DreameS10PlusValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ class DreameS10PlusValetudoRobot extends DreameGen2LidarValetudoRobot {
robot: this
});

this.registerCapability(new capabilities.DreameMapSegmentationCapability({
robot: this,
miot_actions: {
start: {
siid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.SIID,
aiid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.ACTIONS.START.AIID
}
},
miot_properties: {
mode: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.MODE.PIID
},
additionalCleanupParameters: {
piid: DreameGen2ValetudoRobot.MIOT_SERVICES.VACUUM_2.PROPERTIES.ADDITIONAL_CLEANUP_PROPERTIES.PIID
}
},
segmentCleaningModeId: 18,
iterationsSupported: 4,
customOrderSupported: true
}));

this.registerCapability(new capabilities.DreameWaterUsageControlCapability({
robot: this,
presets: Object.keys(this.waterGrades).map(k => {
Expand Down
Loading

0 comments on commit 15c558a

Please sign in to comment.