Skip to content

Commit

Permalink
fix(vendor.dreame): Maps are always persistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Mar 11, 2021
1 parent 531f829 commit 3630fa3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ const StateAttribute = require("./StateAttribute");

class PersistentMapSettingStateAttribute extends StateAttribute {
/**
* @param {object} options
* @param {object} options
* @param {PersistentMapSettingStateAttributeValue} options.value
* @param {object} [options.metaData]
* @param {object} [options.metaData]
*/
constructor(options) {
super(options);
Expand All @@ -20,9 +20,8 @@ class PersistentMapSettingStateAttribute extends StateAttribute {
*/
PersistentMapSettingStateAttribute.VALUE = Object.freeze({
DISABLED: "disabled",
ENABLED: "enabled",
MULTI: "multi" //TODO
ENABLED: "enabled"
});


module.exports = PersistentMapSettingStateAttribute;
module.exports = PersistentMapSettingStateAttribute;
4 changes: 4 additions & 0 deletions lib/robots/dreame/DreameD9ValetudoRobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,10 @@ class DreameD9ValetudoRobot extends DreameValetudoRobot {
voicepack_install_status_piid: MIOT_SERVICES.AUDIO.PROPERTIES.VOICEPACK_INSTALL_STATUS.PIID,
install_voicepack_piid: MIOT_SERVICES.AUDIO.PROPERTIES.INSTALL_VOICEPACK.PIID
}));

this.state.upsertFirstMatchingAttribute(new stateAttrs.PersistentMapSettingStateAttribute({
value: stateAttrs.PersistentMapSettingStateAttribute.VALUE.ENABLED
}));
}

onMessage(msg) {
Expand Down

0 comments on commit 3630fa3

Please sign in to comment.