homebridge-melcloud-control 4.2.3-beta.7 → 4.2.3-beta.8

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.2.3-beta.7",
4
+ "version": "4.2.3-beta.8",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
package/src/melcloud.js CHANGED
@@ -4,8 +4,7 @@ import { promisify } from 'util';
4
4
  import EventEmitter from 'events';
5
5
  import ImpulseGenerator from './impulsegenerator.js';
6
6
  import Functions from './functions.js';
7
- import { ApiUrls, ApiUrlsHome } from './constants.js';
8
- const execPromise = promisify(exec);
7
+ import { ApiUrls } from './constants.js';
9
8
 
10
9
  class MelCloud extends EventEmitter {
11
10
  constructor(account, accountFile, buildingsFile, devicesFile, pluginStart = false) {
@@ -112,11 +112,6 @@ class MelCloudAta extends EventEmitter {
112
112
  this.emit('mqtt', 'State', deviceData.Device);
113
113
  }
114
114
 
115
- //check state changes
116
- const deviceDataHasNotChanged = JSON.stringify(deviceData) === JSON.stringify(this.deviceData);
117
- if (deviceDataHasNotChanged) return;
118
- this.deviceData = deviceData;
119
-
120
115
  //emit info
121
116
  this.emit('deviceInfo', manufacturer, indoor.model, outdoor.model, serialNumber, firmwareAppVersion);
122
117
 
@@ -6,7 +6,7 @@ import EventEmitter from 'events';
6
6
  import puppeteer from 'puppeteer';
7
7
  import ImpulseGenerator from './impulsegenerator.js';
8
8
  import Functions from './functions.js';
9
- import { ApiUrls, ApiUrlsHome } from './constants.js';
9
+ import { ApiUrlsHome } from './constants.js';
10
10
  const execPromise = promisify(exec);
11
11
 
12
12
  class MelCloud extends EventEmitter {
@@ -342,7 +342,7 @@ class MelCloud extends EventEmitter {
342
342
  try {
343
343
  const axiosInstance = axios.create({
344
344
  method: 'POST',
345
- baseURL: ApiUrls.BaseURL,
345
+ baseURL: ApiUrlsHome.BaseURL,
346
346
  timeout: 15000,
347
347
  headers: {
348
348
  'X-MitsContextKey': accountInfo.ContextKey,
@@ -351,7 +351,7 @@ class MelCloud extends EventEmitter {
351
351
  });
352
352
 
353
353
  const payload = { data: accountInfo.LoginData };
354
- await axiosInstance(ApiUrls.UpdateApplicationOptions, payload);
354
+ await axiosInstance(ApiUrlsHome.UpdateApplicationOptions, payload);
355
355
  await this.functions.saveData(this.accountFile, accountInfo);
356
356
  return true;
357
357
  } catch (error) {