sinricpro 2.10.1 → 2.11.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.
- package/CHANGELOG.md +19 -1
- package/lib/events/event_handler.js +4 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,4 +8,22 @@
|
|
|
8
8
|
## [2.7.1]
|
|
9
9
|
|
|
10
10
|
### Features
|
|
11
|
-
* **Push notification feature added**
|
|
11
|
+
* **Push notification feature added**
|
|
12
|
+
|
|
13
|
+
## [2.8.1]
|
|
14
|
+
* feat: Camera support.
|
|
15
|
+
|
|
16
|
+
## [2.9.1]
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
* fix: setThermostatMode
|
|
20
|
+
|
|
21
|
+
## [2.10.1]
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
* fix: adjustTargetTemperature
|
|
25
|
+
|
|
26
|
+
## [2.11.1]
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
* fix: targetTemperature
|
|
@@ -55,19 +55,9 @@ const eventNames = {
|
|
|
55
55
|
mute: "setMute",
|
|
56
56
|
currentTemperature: "currentTemperature",
|
|
57
57
|
pushNotification: "pushNotification",
|
|
58
|
+
targetTemperature: "targetTemperature"
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
-
const actionArr = [
|
|
61
|
-
"setPowerState",
|
|
62
|
-
"setBrightness",
|
|
63
|
-
"setPowerLevel",
|
|
64
|
-
"setColor",
|
|
65
|
-
"setColorTemperature",
|
|
66
|
-
"DoorbellPress",
|
|
67
|
-
"currentTemperature",
|
|
68
|
-
"pushNotification",
|
|
69
|
-
"setThermostatMode",
|
|
70
|
-
];
|
|
60
|
+
|
|
71
61
|
|
|
72
62
|
const getJson = (client, eventName, deviceId, value) => {
|
|
73
63
|
const header = {
|
|
@@ -93,11 +83,11 @@ const getJson = (client, eventName, deviceId, value) => {
|
|
|
93
83
|
};
|
|
94
84
|
|
|
95
85
|
const raiseEvent = async (client, eventName, deviceId, value) => {
|
|
96
|
-
if (
|
|
86
|
+
if (Object.hasOwn(eventNames, eventName)) {
|
|
97
87
|
try {
|
|
98
88
|
await burstyLimiter.consume("queue");
|
|
99
89
|
const request = JSON.stringify(getJson(client, eventName, deviceId, value));
|
|
100
|
-
if (process.env.SR_DEBUG) console.log(">> %
|
|
90
|
+
if (process.env.SR_DEBUG) console.log(">> %s", request);
|
|
101
91
|
client.send(request);
|
|
102
92
|
} catch (rlRejected) {
|
|
103
93
|
console.log("Too many events!");
|