node-switchbot 1.8.0-beta.3 → 1.8.0-beta.5

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.
@@ -94,7 +94,7 @@ class SwitchbotAdvertising {
94
94
  sd = this._parseServiceDataForWoContact(buf, onlog);//WoContact
95
95
  } else if (model === "c") {
96
96
  sd = this._parseServiceDataForWoCurtain(buf, onlog);// WoCurtain
97
- } else if (model === "x" || 'X') {
97
+ } else if (model === "x") {
98
98
  sd = this._parseServiceDataForWoBlindTilt(buf, onlog);// WoBlindTilt
99
99
  } else if (model === "u") {
100
100
  sd = this._parseServiceDataForWoBulb(manufacturerData, onlog);// WoBulb
@@ -49,7 +49,7 @@ class SwitchbotDeviceWoCurtain extends SwitchbotDevice {
49
49
 
50
50
  /* ------------------------------------------------------------------
51
51
  * runToPos()
52
- * - run to the targe position
52
+ * - run to the target position
53
53
  *
54
54
  * [Arguments]
55
55
  * - percent | number | Required | the percentage of target position
@@ -63,7 +63,7 @@ class SwitchbotDeviceWoCurtain extends SwitchbotDevice {
63
63
  return new Promise((resolve, reject) => {
64
64
  reject(
65
65
  new Error(
66
- "The type of target position percentage is incorrent: " +
66
+ "The type of target position percentage is incorrect: " +
67
67
  typeof percent
68
68
  )
69
69
  );
@@ -75,7 +75,7 @@ class SwitchbotDeviceWoCurtain extends SwitchbotDevice {
75
75
  if (typeof mode != "number") {
76
76
  return new Promise((resolve, reject) => {
77
77
  reject(
78
- new Error("The type of running mode is incorrent: " + typeof mode)
78
+ new Error("The type of running mode is incorrect: " + typeof mode)
79
79
  );
80
80
  });
81
81
  }
@@ -444,7 +444,7 @@ class SwitchbotDevice {
444
444
  this._connect()
445
445
  .then(() => {
446
446
  if (!this._chars) {
447
- return reject("No characteristics available.");
447
+ return reject(new Error("No characteristics available."));
448
448
  }
449
449
  return this._write(this._chars.write, req_buf);
450
450
  })
package/lib/switchbot.js CHANGED
@@ -107,7 +107,6 @@ class Switchbot {
107
107
  "i",
108
108
  "r",
109
109
  "x",
110
- "X",
111
110
  ],
112
111
  },
113
112
  id: { required: false, type: "string", min: 12, max: 17 },
@@ -246,7 +245,6 @@ class Switchbot {
246
245
  device = new SwitchbotDeviceWoCurtain(peripheral, this.noble);
247
246
  break;
248
247
  case "x":
249
- case "X":
250
248
  device = new SwitchbotDeviceWoBlindTilt(peripheral, this.noble);
251
249
  break;
252
250
  case "u":
@@ -371,7 +369,6 @@ class Switchbot {
371
369
  "i",
372
370
  "r",
373
371
  "x",
374
- "X",
375
372
  ],
376
373
  },
377
374
  id: { required: false, type: "string", min: 12, max: 17 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-switchbot",
3
- "version": "1.8.0-beta.3",
3
+ "version": "1.8.0-beta.5",
4
4
  "description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE).",
5
5
  "main": "./lib/switchbot.js",
6
6
  "files": [