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

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.
@@ -338,12 +338,13 @@ module.exports = class extends (
338
338
 
339
339
  return this.call('get_properties', properties)
340
340
  .then((result) => {
341
- const mapped = {};
342
- props.forEach((prop) => {
343
- let value = result[prop];
344
- this._pushProperty(mapped, prop, value);
341
+ const mapped = {};
342
+ result.forEach((prop) => {
343
+ if (prop.code === 0) {
344
+ this._pushProperty(mapped, prop.did, prop.value);
345
+ }
346
+ });
347
+ return mapped;
345
348
  });
346
- return mapped;
347
- });
348
349
  }
349
350
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-miio",
3
- "version": "0.3.0-beta.1",
3
+ "version": "0.3.0-beta.2",
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",