Skip to content

Commit

Permalink
fix(vendor.roborock): copy statusflag from previous state on state up…
Browse files Browse the repository at this point in the history
…date (#1497)
  • Loading branch information
004helix committed May 11, 2022
1 parent 356d144 commit 84de0ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/lib/robots/roborock/RoborockValetudoRobot.js
Expand Up @@ -212,14 +212,16 @@ class RoborockValetudoRobot extends MiioValetudoRobot {
if (data["in_cleaning"] === undefined) {
const previousState = this.state.getFirstMatchingAttributeByConstructor(stateAttrs.StatusStateAttribute);

// keep mataData from previous state
// keep statusFlag and metaData from previous state
if (previousState &&
(
previousState.value === stateAttrs.StatusStateAttribute.VALUE.PAUSED ||
previousState.value === stateAttrs.StatusStateAttribute.VALUE.RETURNING ||
previousState.value === stateAttrs.StatusStateAttribute.VALUE.DOCKED
)
) {
statusFlag = previousState.flag;

if (previousState.metaData.zoned === true) {
statusMetaData.zoned = true;
} else if (previousState.metaData.segment_cleaning === true) {
Expand Down

0 comments on commit 84de0ef

Please sign in to comment.