homebridge-verisure 2.0.0-rc.4 → 2.0.0
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 +14 -0
- package/lib/accessories/doorlock.js +4 -4
- package/lib/platform.js +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 2.0.0 (Mar 20, 2023)
|
|
2
|
+
|
|
3
|
+
### Config
|
|
4
|
+
|
|
5
|
+
* __BREAKING__: Property `cookies` replaces `token`. See README for how to get and configure.
|
|
6
|
+
|
|
7
|
+
### Plugin & accessories
|
|
8
|
+
|
|
9
|
+
* Use Verisure GraphQL API.
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* Bump `verisure` module to support GraphQL requests.
|
|
14
|
+
|
|
1
15
|
## 1.16.0 (Aug 27, 2022)
|
|
2
16
|
|
|
3
17
|
### Plugin
|
|
@@ -35,6 +35,8 @@ class DoorLock extends VerisureAccessory {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
getDoorLockState() {
|
|
38
|
+
this.log('Getting current lock state.', 'debug');
|
|
39
|
+
|
|
38
40
|
return this.installation.client(overviewOperation)
|
|
39
41
|
.then((overview) => overview.installation.doorlocks
|
|
40
42
|
.find((doorlock) => doorlock.device.deviceLabel === this.serialNumber))
|
|
@@ -47,8 +49,6 @@ class DoorLock extends VerisureAccessory {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
getCurrentLockState(callback) {
|
|
50
|
-
this.log('Getting current lock state.', 'debug');
|
|
51
|
-
|
|
52
52
|
// TODO: Use this.cachedValue, if available?
|
|
53
53
|
|
|
54
54
|
this.getDoorLockState().then((doorLock) => {
|
|
@@ -117,7 +117,6 @@ class DoorLock extends VerisureAccessory {
|
|
|
117
117
|
|
|
118
118
|
this.installation.client(doorLockConfigOperation(this.serialNumber))
|
|
119
119
|
.then(({ installation: { smartLocks: [smartLock] } }) => {
|
|
120
|
-
this.log(`Got config: ${JSON.stringify(smartLock)}`, 'debug');
|
|
121
120
|
this.autoLockState = DoorLock.resolveAutoLockState(smartLock.configuration);
|
|
122
121
|
callback(null, this.autoLockState);
|
|
123
122
|
})
|
|
@@ -145,7 +144,6 @@ class DoorLock extends VerisureAccessory {
|
|
|
145
144
|
|
|
146
145
|
this.installation.client(doorLockConfigOperation(this.serialNumber))
|
|
147
146
|
.then(({ installation: { smartLocks: [smartLock] } }) => {
|
|
148
|
-
this.log(`Got config: ${JSON.stringify(smartLock)}`, 'debug');
|
|
149
147
|
this.audioState = smartLock.configuration.volume !== this.platformConfig.audioOffValue;
|
|
150
148
|
callback(null, this.audioState);
|
|
151
149
|
})
|
|
@@ -159,6 +157,8 @@ class DoorLock extends VerisureAccessory {
|
|
|
159
157
|
? this.platformConfig.audioOnValue
|
|
160
158
|
: this.platformConfig.audioOffValue;
|
|
161
159
|
|
|
160
|
+
this.log(`Setting audio volume to: ${volume}`);
|
|
161
|
+
|
|
162
162
|
this.installation.client(
|
|
163
163
|
doorLockUpdateConfigOperation(this.serialNumber, { volume }),
|
|
164
164
|
)
|
package/lib/platform.js
CHANGED
|
@@ -17,6 +17,7 @@ class VerisurePlatform {
|
|
|
17
17
|
VERISURE_EMAIL,
|
|
18
18
|
VERISURE_PASSWORD,
|
|
19
19
|
VERISURE_COOKIES,
|
|
20
|
+
VERISURE_TOKEN, // Deprecated.
|
|
20
21
|
} = process.env;
|
|
21
22
|
|
|
22
23
|
const {
|
|
@@ -31,6 +32,7 @@ class VerisurePlatform {
|
|
|
31
32
|
showAudioSwitch = true,
|
|
32
33
|
audioOffValue = 'LOW',
|
|
33
34
|
audioOnValue = 'HIGH',
|
|
35
|
+
token, // Deprecated.
|
|
34
36
|
} = config;
|
|
35
37
|
|
|
36
38
|
this.config = {
|
|
@@ -50,6 +52,10 @@ class VerisurePlatform {
|
|
|
50
52
|
this.homebridge = homebridge;
|
|
51
53
|
this.logger = logger;
|
|
52
54
|
|
|
55
|
+
if (VERISURE_TOKEN || token) {
|
|
56
|
+
this.logger.error('DEPRECATED: Property "token" in config. Please see README to get and configure "cookies".');
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
this.verisure = new Verisure(
|
|
54
60
|
this.config.email,
|
|
55
61
|
this.config.password,
|