@homebridge-plugins/homebridge-tado 9.1.0 → 9.1.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 +3 -0
- package/package.json +2 -2
- package/src/tado/tado-api.js +2 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homebridge-plugins/homebridge-tado",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"description": "Homebridge plugin for controlling tado° devices.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@homebridge/plugin-ui-utils": "^2.2.3",
|
|
37
37
|
"fakegato-history": "^0.6.7",
|
|
38
38
|
"form-data": "^4.0.5",
|
|
39
|
-
"fs-extra": "^11.3.
|
|
39
|
+
"fs-extra": "^11.3.5",
|
|
40
40
|
"got": "^15.0.5",
|
|
41
41
|
"moment": "^2.30.1"
|
|
42
42
|
},
|
package/src/tado/tado-api.js
CHANGED
|
@@ -225,7 +225,7 @@ export default class Tado {
|
|
|
225
225
|
if (tokenResponse?.body) {
|
|
226
226
|
const { access_token, refresh_token } = tokenResponse.body;
|
|
227
227
|
if (access_token && refresh_token) {
|
|
228
|
-
await this._verifyAuthenticatedIdentity();
|
|
228
|
+
await this._verifyAuthenticatedIdentity(access_token);
|
|
229
229
|
await writeFile(this._tadoInternalTokenFilePath, JSON.stringify({ access_token, refresh_token }));
|
|
230
230
|
this._tadoBearerToken = { access_token, refresh_token, timestamp: Date.now() };
|
|
231
231
|
Logger.info("Authentication successful!");
|
|
@@ -246,9 +246,8 @@ export default class Tado {
|
|
|
246
246
|
* poisons a token file. Uses got directly because apiCall -> getToken would
|
|
247
247
|
* re-enter the in-flight token promise and deadlock.
|
|
248
248
|
*/
|
|
249
|
-
async _verifyAuthenticatedIdentity() {
|
|
249
|
+
async _verifyAuthenticatedIdentity(access_token) {
|
|
250
250
|
if (!this.username) return;
|
|
251
|
-
const access_token = this._tadoBearerToken?.access_token;
|
|
252
251
|
if (!access_token) throw new Error('No access token available for identity verification.');
|
|
253
252
|
const url = `${this.tadoApiUrl}/api/v2/me`;
|
|
254
253
|
let me;
|