homebridge-melcloud-control 4.0.0-beta.338 → 4.0.0-beta.339

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.338",
4
+ "version": "4.0.0-beta.339",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -94,15 +94,14 @@ class MelCloudHomeToken extends EventEmitter {
94
94
  code_verifier: codeVerifier,
95
95
  });
96
96
 
97
- const tokenResponse = await axios(TOKEN_ENDPOINT, tokenData.toString(), {
98
- method: 'POST',
97
+ const tokenResponse = await axios.post(TOKEN_ENDPOINT, tokenData.toString(), {
99
98
  headers: {
100
99
  'Content-Type': 'application/x-www-form-urlencoded',
101
100
  'Content-Length': tokenData.toString().length,
102
101
  'Authorization': 'Basic aG9tZW1vYmlsZTo=',
103
102
  },
104
103
  });
105
- const tokens = JSON.parse(tokenResponse);
104
+ const tokens = JSON.parse(tokenResponse.data);
106
105
 
107
106
  this.emit('warn', `Token ${tokens}`);
108
107
  return tokens;