Skip to content

Commit

Permalink
feat(vendor.dreame): Minor improvements for D9 Firmware 1072
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Jan 31, 2021
1 parent 8226e4a commit ef949be
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/DreameMapParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DreameMapParser {
Math.round(parsedHeader.robot_position.x - parsedHeader.left)
],
metaData: {
angle: (parsedHeader.robot_position.angle + 450) % 360
angle: (parsedHeader.robot_position.angle + 540) % 360
},
type: Map.PointMapEntity.TYPE.ROBOT_POSITION
})
Expand All @@ -67,7 +67,7 @@ class DreameMapParser {
Math.round(parsedHeader.charger_position.x - parsedHeader.left)
],
metaData: {
angle: (parsedHeader.charger_position.angle + 450) % 360
angle: (parsedHeader.charger_position.angle + 540) % 360
},
type: Map.PointMapEntity.TYPE.CHARGER_LOCATION
})
Expand Down
26 changes: 22 additions & 4 deletions lib/robots/dreame/DreameD9ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,34 @@ class DreameD9ValetudoRobot extends DreameValetudoRobot {
}
});

//this.parseAndUpdateState(msg.params);
this.sendCloud({id: msg.id, "result":["ok"]});
this.sendCloud({id: msg.id, "result":"ok"});
return true;
}
case "props":
if (msg.params && msg.params.ota_state) {
this.sendCloud({id: msg.id, "result":["ok"]});
this.sendCloud({id: msg.id, "result":"ok"});
return true;
}
break;
case "event_occured": {
switch (msg.params.siid) {
case MIOT_SERVICES.VACUUM_2.SIID:
this.parseAndUpdateState(msg.params.arguments.map(a => {
return {
siid: msg.params.siid,
piid: a.piid,
value: a.value
};
}));
this.sendCloud({id: msg.id, "result":"ok"});
break;
default:
Logger.warn("Unhandled event", msg);
this.sendCloud({id: msg.id, "result":"ok"});
}

return true;
}
}

return false;
Expand All @@ -374,7 +392,7 @@ class DreameD9ValetudoRobot extends DreameValetudoRobot {
piid: MIOT_SERVICES.BATTERY.PROPERTIES.LEVEL.PIID
}
].map(e => {
e.did = this.deviceId; //TODO
e.did = this.deviceId;

return e;
}));
Expand Down

0 comments on commit ef949be

Please sign in to comment.