homebridge-flume 3.0.1 → 3.0.2
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 +6 -0
- package/README.md +5 -5
- package/lib/connection/http.js +16 -9
- package/lib/homebridge-ui/public/index.html +0 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -11,8 +11,8 @@ Homebridge plugin to integrate Flume devices into HomeKit
|
|
|
11
11
|
[](https://plugins.hoobs.org/plugin/homebridge-thermobit)
|
|
12
12
|
[](https://www.npmjs.com/package/homebridge-flume)
|
|
13
13
|
[](https://github.com/bwp91/homebridge-flume/wiki/Beta-Version)
|
|
14
|
-
[](https://www.npmjs.com/package/homebridge-flume)
|
|
15
|
+
[](https://www.npmjs.com/package/homebridge-flume)
|
|
16
16
|
[](https://discord.com/channels/784827113378676736/784827113378676739)
|
|
17
17
|
[](https://discord.com/channels/432663330281226270/742733745743855627)
|
|
18
18
|
|
|
@@ -24,8 +24,9 @@ Homebridge plugin to integrate Flume devices into HomeKit
|
|
|
24
24
|
|
|
25
25
|
### Prerequisites
|
|
26
26
|
|
|
27
|
-
- To use this plugin, you will need to already have
|
|
28
|
-
-
|
|
27
|
+
- To use this plugin, you will need to already have:
|
|
28
|
+
- [Homebridge](https://homebridge.io): v1.6 or [HOOBS](https://hoobs.org): v4.3 installed - refer to the links for more information and installation instructions.
|
|
29
|
+
- Node: latest version of v16 or v18 - any other major version is not supported.
|
|
29
30
|
|
|
30
31
|
### Setup
|
|
31
32
|
|
|
@@ -33,7 +34,6 @@ Homebridge plugin to integrate Flume devices into HomeKit
|
|
|
33
34
|
- [Configuration](https://github.com/bwp91/homebridge-flume/wiki/Configuration)
|
|
34
35
|
- [Beta Version](https://github.com/bwp91/homebridge-flume/wiki/Beta-Version)
|
|
35
36
|
- [Node Version](https://github.com/bwp91/homebridge-flume/wiki/Node-Version)
|
|
36
|
-
- [Uninstallation](https://github.com/bwp91/homebridge-flume/wiki/Uninstallation)
|
|
37
37
|
|
|
38
38
|
### Help/About
|
|
39
39
|
|
package/lib/connection/http.js
CHANGED
|
@@ -57,9 +57,6 @@ export default class {
|
|
|
57
57
|
}
|
|
58
58
|
*/
|
|
59
59
|
|
|
60
|
-
// Log the response if in debug mode
|
|
61
|
-
this.log.debug('[HTTP obtainToken()] %s.', JSON.stringify(res.data));
|
|
62
|
-
|
|
63
60
|
// Check to see we got a proper response
|
|
64
61
|
if (!res.data.data || !res.data.data[0]) {
|
|
65
62
|
this.log.warn('[HTTP obtainToken()] %s.', JSON.stringify(res.data));
|
|
@@ -71,6 +68,12 @@ export default class {
|
|
|
71
68
|
this.refreshToken = res.data.data[0].refresh_token;
|
|
72
69
|
this.expiresIn = now + res.data.data[0].expires_in;
|
|
73
70
|
|
|
71
|
+
// Log the response if in debug mode
|
|
72
|
+
this.log.debug(
|
|
73
|
+
'[HTTP obtainToken()] %s.',
|
|
74
|
+
JSON.stringify(res.data).replaceAll(this.accessToken, '[redacted]').replaceAll(this.refreshToken, '[redacted]'),
|
|
75
|
+
);
|
|
76
|
+
|
|
74
77
|
// Obtain the user ID
|
|
75
78
|
this.userId = jwtDecode(this.accessToken).user_id;
|
|
76
79
|
|
|
@@ -123,8 +126,17 @@ export default class {
|
|
|
123
126
|
throw new Error(platformLang.noDataReceived);
|
|
124
127
|
}
|
|
125
128
|
|
|
129
|
+
// Make the token available in other functions
|
|
130
|
+
this.accessToken = res.data.data[0].access_token;
|
|
131
|
+
this.refreshToken = res.data.data[0].refresh_token;
|
|
132
|
+
this.expiresIn = now + res.data.data[0].expires_in;
|
|
133
|
+
|
|
126
134
|
// Log the response if in debug mode
|
|
127
|
-
|
|
135
|
+
// Redact the access token and refresh token
|
|
136
|
+
this.log.debug(
|
|
137
|
+
'[HTTP renewToken()] %s.',
|
|
138
|
+
JSON.stringify(res.data).replaceAll(this.accessToken, '[redacted]').replaceAll(this.refreshToken, '[redacted]'),
|
|
139
|
+
);
|
|
128
140
|
|
|
129
141
|
/*
|
|
130
142
|
{
|
|
@@ -146,11 +158,6 @@ export default class {
|
|
|
146
158
|
pagination: null
|
|
147
159
|
}
|
|
148
160
|
*/
|
|
149
|
-
|
|
150
|
-
// Make the token available in other functions
|
|
151
|
-
this.accessToken = res.data.data[0].access_token;
|
|
152
|
-
this.refreshToken = res.data.data[0].refresh_token;
|
|
153
|
-
this.expiresIn = now + res.data.data[0].expires_in;
|
|
154
161
|
return true;
|
|
155
162
|
} catch (err) {
|
|
156
163
|
if (err.code && platformConsts.httpRetryCodes.includes(err.code)) {
|