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 CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to homebridge-flume will be documented in this file.
4
4
 
5
+ ## 3.0.2 (2023-03-24)
6
+
7
+ ### Fixed
8
+
9
+ - Debug logging
10
+
5
11
  ## 3.0.1 (2023-03-11)
6
12
 
7
13
  ### Fixed
package/README.md CHANGED
@@ -11,8 +11,8 @@ Homebridge plugin to integrate Flume devices into HomeKit
11
11
  [![hoobs-certified](https://badgen.net/badge/HOOBS/certified/yellow)](https://plugins.hoobs.org/plugin/homebridge-thermobit)
12
12
  [![npm](https://img.shields.io/npm/v/homebridge-flume/latest?label=latest)](https://www.npmjs.com/package/homebridge-flume)
13
13
  [![npm](https://img.shields.io/npm/v/homebridge-flume/beta?label=beta)](https://github.com/bwp91/homebridge-flume/wiki/Beta-Version)
14
- [![npm](https://img.shields.io/npm/dt/homebridge-flume)](https://www.npmjs.com/package/homebridge-flume)
15
- [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
14
+ [![npm](https://img.shields.io/npm/dw/homebridge-flume)](https://www.npmjs.com/package/homebridge-flume)
15
+ [![npm](https://img.shields.io/npm/dt/homebridge-flume)](https://www.npmjs.com/package/homebridge-flume)
16
16
  [![Discord](https://img.shields.io/discord/784827113378676736?color=728ED5&logo=discord&label=bwp91-discord)](https://discord.com/channels/784827113378676736/784827113378676739)
17
17
  [![Discord](https://img.shields.io/discord/432663330281226270?color=728ED5&logo=discord&label=hb-discord)](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 [Homebridge](https://homebridge.io) (at least v1.4) or [HOOBS](https://hoobs.org) (at least v4.2) installed. Refer to the links for more information and installation instructions.
28
- - Whilst it is recommended to use [Node](https://nodejs.org/en/) v16, the plugin supports v14 as per the [Homebridge guidelines](https://github.com/homebridge/homebridge/wiki/How-To-Update-Node.js).
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
 
@@ -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
- this.log.debug('[HTTP renewToken()] %s.', JSON.stringify(res.data));
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)) {
@@ -47,11 +47,6 @@
47
47
  >Node Version</a
48
48
  >
49
49
  </li>
50
- <li>
51
- <a href="https://github.com/bwp91/homebridge-flume/wiki/Uninstallation" target="_blank"
52
- >Uninstallation</a
53
- >
54
- </li>
55
50
  </ul>
56
51
  <h4>Help/About</h4>
57
52
  <ul>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-flume",
3
3
  "alias": "Flume",
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "author": {
6
6
  "name": "Ben Potter",
7
7
  "email": "bwp91@icloud.com"