node-switchbot 1.1.3-beta.1 → 1.1.3-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.
@@ -4,8 +4,8 @@ const SwitchbotDevice = require('./switchbot-device.js');
4
4
  class SwitchbotDeviceWoHumi extends SwitchbotDevice {
5
5
 
6
6
  /* ------------------------------------------------------------------
7
- * Auto()
8
- * - Set Mode to Auto
7
+ * press()
8
+ * - Press
9
9
  *
10
10
  * [Arguments]
11
11
  * - none
@@ -14,13 +14,13 @@ class SwitchbotDeviceWoHumi extends SwitchbotDevice {
14
14
  * - Promise object
15
15
  * Nothing will be passed to the `resolve()`.
16
16
  * ---------------------------------------------------------------- */
17
- Auto() {
18
- return this._operateHumi([0x57, 0x01, 0x80]);
17
+ press() {
18
+ return this._operateBot([0x57, 0x01, 0x00]);
19
19
  }
20
20
 
21
21
  /* ------------------------------------------------------------------
22
- * First()
23
- * - Set Mode to First
22
+ * turnOn()
23
+ * - Turn on
24
24
  *
25
25
  * [Arguments]
26
26
  * - none
@@ -29,13 +29,13 @@ class SwitchbotDeviceWoHumi extends SwitchbotDevice {
29
29
  * - Promise object
30
30
  * Nothing will be passed to the `resolve()`.
31
31
  * ---------------------------------------------------------------- */
32
- First() {
33
- return this._operateHumi([0x57, 0x01, 0x65]);
32
+ turnOn() {
33
+ return this._operateBot([0x57, 0x01, 0x01]);
34
34
  }
35
35
 
36
36
  /* ------------------------------------------------------------------
37
- * Second()
38
- * - Set Mode to Second
37
+ * turnOff()
38
+ * - Turn off
39
39
  *
40
40
  * [Arguments]
41
41
  * - none
@@ -44,13 +44,13 @@ class SwitchbotDeviceWoHumi extends SwitchbotDevice {
44
44
  * - Promise object
45
45
  * Nothing will be passed to the `resolve()`.
46
46
  * ---------------------------------------------------------------- */
47
- Second() {
48
- return this._operateHumi([0x57, 0x01, 0x66]);
47
+ turnOff() {
48
+ return this._operateBot([0x57, 0x01, 0x02]);
49
49
  }
50
50
 
51
51
  /* ------------------------------------------------------------------
52
- * Third()
53
- * - Set Mode to Third
52
+ * down()
53
+ * - Down
54
54
  *
55
55
  * [Arguments]
56
56
  * - none
@@ -59,8 +59,8 @@ class SwitchbotDeviceWoHumi extends SwitchbotDevice {
59
59
  * - Promise object
60
60
  * Nothing will be passed to the `resolve()`.
61
61
  * ---------------------------------------------------------------- */
62
- Third() {
63
- return this._operateHumi([0x57, 0x01, 0x67]);
62
+ down() {
63
+ return this._operateBot([0x57, 0x01, 0x03]);
64
64
  }
65
65
 
66
66
  /* ------------------------------------------------------------------
@@ -74,26 +74,11 @@ class SwitchbotDeviceWoHumi extends SwitchbotDevice {
74
74
  * - Promise object
75
75
  * Nothing will be passed to the `resolve()`.
76
76
  * ---------------------------------------------------------------- */
77
- percentage() {
78
- return this._operateHumi([0x57, 0x01, 0x01]);
77
+ up() {
78
+ return this._operateBot([0x57, 0x01, 0x04]);
79
79
  }
80
80
 
81
- /* ------------------------------------------------------------------
82
- * turnOff()
83
- * - Turn off
84
- *
85
- * [Arguments]
86
- * - none
87
- *
88
- * [Returen value]
89
- * - Promise object
90
- * Nothing will be passed to the `resolve()`.
91
- * ---------------------------------------------------------------- */
92
- turnOff() {
93
- return this._operateHumi([0x57, 0x01, 0x02]);
94
- }
95
-
96
- _operateHumi(bytes) {
81
+ _operateBot(bytes) {
97
82
  return new Promise((resolve, reject) => {
98
83
  let req_buf = Buffer.from(bytes);
99
84
  this._command(req_buf).then((res_buf) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-switchbot",
3
- "version": "1.1.3-beta.1",
3
+ "version": "1.1.3-beta.5",
4
4
  "description": "The node-switchbot is a Node.js module which allows you to move your Switchbot (Bot)'s arm and Switchbot Curtain(Curtain), also monitor the temperature/humidity from SwitchBot Thermometer & Hygrometer (Meter).",
5
5
  "main": "./lib/switchbot.js",
6
6
  "files": [
@@ -37,6 +37,6 @@
37
37
  "@abandonware/noble": "^1.9.2-15"
38
38
  },
39
39
  "devDependencies": {
40
- "npm-check-updates": "^12.0.5"
40
+ "npm-check-updates": "^12.0.2"
41
41
  }
42
42
  }