Skip to content

Commit

Permalink
fix(vacuum.viomi): Fix fan speed state parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Dec 30, 2020
1 parent d06520d commit 3ca7450
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/robots/viomi/ViomiValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ class ViomiValetudoRobot extends MiioValetudoRobot {

if (data["suction_grade"] !== undefined) {
let matchingFanSpeed = Object.keys(this.fanSpeeds).find(key => this.fanSpeeds[key] === data["suction_grade"]);
this.state.upsertFirstMatchingAttribute(new stateAttrs.FanSpeedStateAttribute({
value: matchingFanSpeed

this.state.upsertFirstMatchingAttribute(new stateAttrs.IntensityStateAttribute({
type: stateAttrs.IntensityStateAttribute.TYPE.FAN_SPEED,
value: matchingFanSpeed,
customValue: matchingFanSpeed === stateAttrs.IntensityStateAttribute.VALUE.CUSTOM ? data["suction_grade"] : undefined
}));
}

Expand Down

0 comments on commit 3ca7450

Please sign in to comment.