node-miio 0.3.0-beta.0 → 0.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,8 +36,8 @@ module.exports = class extends (
36
36
 
37
37
  this.defineProperty('device_fault', {
38
38
  name: 'error',
39
- siid: 2,
40
- piid: 2,
39
+ siid: this.miioModel === 'dreame.vacuum.mc1808' ? 3 : 2,
40
+ piid: this.miioModel === 'dreame.vacuum.mc1808' ? 1 : 2,
41
41
  mapper: (e) => {
42
42
  let message;
43
43
  switch (e) {
@@ -56,8 +56,8 @@ module.exports = class extends (
56
56
 
57
57
  this.defineProperty('device_status', {
58
58
  name: 'state',
59
- siid: 2,
60
- piid: 1,
59
+ siid: this.miioModel === 'dreame.vacuum.mc1808' ? 3 : 2,
60
+ piid: this.miioModel === 'dreame.vacuum.mc1808' ? 2 : 1,
61
61
  mapper: (s) => {
62
62
  // https://python-miio.readthedocs.io/en/latest/api/miio.integrations.dreame.vacuum.dreamevacuum_miot.html#miio.integrations.dreame.vacuum.dreamevacuum_miot.DeviceStatus
63
63
  switch (s) {
@@ -97,13 +97,13 @@ module.exports = class extends (
97
97
  // Define the batteryLevel property for monitoring battery
98
98
  this.defineProperty('battery_level', {
99
99
  name: 'batteryLevel',
100
- siid: 3,
100
+ siid: this.miioModel === 'dreame.vacuum.mc1808' ? 2 : 3,
101
101
  piid: 1,
102
102
  });
103
103
 
104
104
  this.defineProperty('charging_state', {
105
105
  name: 'charging',
106
- siid: 3,
106
+ siid: this.miioModel === 'dreame.vacuum.mc1808' ? 2 : 3,
107
107
  piid: 2,
108
108
  mapper: (s) => {
109
109
  switch (s) {
@@ -121,12 +121,12 @@ module.exports = class extends (
121
121
 
122
122
  this.defineProperty('cleaning_mode', {
123
123
  name: 'fanSpeed',
124
- siid: 18,
125
- piid: 6
124
+ siid: this.miioModel === 'dreame.vacuum.mc1808' ? 18 : 4,
125
+ piid: this.miioModel === 'dreame.vacuum.mc1808' ? 6 : 4,
126
126
  });
127
127
  this.defineProperty('operating_mode', {
128
128
  name: 'cleaningMode',
129
- siid: 18,
129
+ siid: this.miioModel === 'dreame.vacuum.mc1808' ? 18 : 4,
130
130
  piid: 1,
131
131
  mapper: (v) => {
132
132
  switch (v) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-miio",
3
- "version": "0.3.0-beta.0",
3
+ "version": "0.3.0-beta.1",
4
4
  "license": "MIT",
5
5
  "description": "Control Mi Home devices, such as Mi Robot Vacuums, Mi Air Purifiers, Mi Smart Home Gateway (Aqara) and more",
6
6
  "author": "https://github.com/afharo",