node-switchbot 1.8.2-beta.5 → 1.8.2-beta.7

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.
@@ -494,7 +494,7 @@ class ParameterChecker {
494
494
  }
495
495
  }
496
496
  if (rule.pattern instanceof RegExp) {
497
- if (!rule.pattern.test(v)) {
497
+ if (!rule.pattern.test(value)) {
498
498
  this._error = {
499
499
  code: "PATTERN_UNMATCH",
500
500
  message: "The `" + name + "` does not conform with the pattern.",
@@ -409,7 +409,7 @@ class SwitchbotAdvertising {
409
409
  return null;
410
410
  }
411
411
  const byte1 = manufacturerData.readUInt8(1);//power and light status
412
- const byte2 = manufacturerData.readUInt8(2);//bulb brightness
412
+ //const byte2 = manufacturerData.readUInt8(2);//bulb brightness
413
413
  const byte3 = manufacturerData.readUInt8(3);//bulb R
414
414
  const byte4 = manufacturerData.readUInt8(4);//bulb G
415
415
  const byte5 = manufacturerData.readUInt8(5);//bulb B
@@ -624,8 +624,8 @@ class SwitchbotAdvertising {
624
624
  return null;
625
625
  }
626
626
 
627
- const byte1 = buf.readUInt8(1);//power and light status
628
- const byte2 = buf.readUInt8(2);//bulb brightness
627
+ //const byte1 = buf.readUInt8(1);//power and light status
628
+ //const byte2 = buf.readUInt8(2);//bulb brightness
629
629
  const byte3 = buf.readUInt8(3);//bulb R
630
630
  const byte4 = buf.readUInt8(4);//bulb G
631
631
  const byte5 = buf.readUInt8(5);//bulb B
package/lib/switchbot.js CHANGED
@@ -257,7 +257,7 @@ class Switchbot {
257
257
  device = new SwitchbotDeviceWoPlugMini(peripheral, this.noble);
258
258
  break;
259
259
  case "o":
260
- device = new SwitchbotDeviceWoSmartLock(peripheral, this.noble);
260
+ //device = new SwitchbotDeviceWoSmartLock(peripheral, this.noble);
261
261
  break;
262
262
  case "i":
263
263
  device = new SwitchbotDeviceWoSensorTH(peripheral, this.noble);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-switchbot",
3
- "version": "1.8.2-beta.5",
3
+ "version": "1.8.2-beta.7",
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": [
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "scripts": {
13
13
  "check": "npm install && npm outdated",
14
- "update": "ncu -u && npm update && npm install"
14
+ "update": "ncu -u && npm update && npm install",
15
+ "lint": "eslint . --ext .js"
15
16
  },
16
17
  "keywords": [
17
18
  "switchbot",
@@ -41,6 +42,7 @@
41
42
  "@abandonware/bluetooth-hci-socket": "0.5.3-10"
42
43
  },
43
44
  "devDependencies": {
45
+ "eslint": "^8.45.0",
44
46
  "npm-check-updates": "^16.10.17"
45
47
  }
46
48
  }