homebridge-melcloud-control 3.10.0-beta.30 → 3.10.0-beta.31

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/index.js CHANGED
@@ -145,15 +145,15 @@ class MelCloudPlatform {
145
145
  let configuredDevice;
146
146
  switch (deviceType) {
147
147
  case 0: //ATA
148
- configuredDevice = new DeviceAta(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, useFahrenheit, restFul, mqtt);
148
+ configuredDevice = new DeviceAta(api, account, device, contextKey, devicesFile, useFahrenheit, restFul, mqtt);
149
149
  break;
150
150
  case 1: //ATW
151
- configuredDevice = new DeviceAtw(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, useFahrenheit, restFul, mqtt);
151
+ configuredDevice = new DeviceAtw(api, account, device, contextKey, devicesFile, useFahrenheit, restFul, mqtt);
152
152
  break;
153
153
  case 2:
154
154
  break;
155
155
  case 3: //ERV
156
- configuredDevice = new DeviceErv(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, useFahrenheit, restFul, mqtt);
156
+ configuredDevice = new DeviceErv(api, account, device, contextKey, devicesFile, useFahrenheit, restFul, mqtt);
157
157
  break;
158
158
  default:
159
159
  if (logLevel.warn) log.warn(`${accountName}, ${deviceTypeText}, ${deviceName}, unknown device: ${deviceType}.`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.10.0-beta.30",
4
+ "version": "3.10.0-beta.31",
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/deviceata.js CHANGED
@@ -6,7 +6,7 @@ import { TemperatureDisplayUnits, AirConditioner } from './constants.js';
6
6
  let Accessory, Characteristic, Service, Categories, AccessoryUUID;
7
7
 
8
8
  class DeviceAta extends EventEmitter {
9
- constructor(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, useFahrenheit, restFul, mqtt) {
9
+ constructor(api, account, device, contextKey, devicesFile, useFahrenheit, restFul, mqtt) {
10
10
  super();
11
11
 
12
12
  Accessory = api.platformAccessory;
@@ -16,6 +16,7 @@ class DeviceAta extends EventEmitter {
16
16
  AccessoryUUID = api.hap.uuid;
17
17
 
18
18
  //account config
19
+ this.device = device;
19
20
  this.displayMode = device.displayMode;
20
21
  this.temperatureSensor = device.temperatureSensor || false;
21
22
  this.temperatureSensorOutdoor = device.temperatureSensorOutdoor || false;
@@ -29,10 +30,10 @@ class DeviceAta extends EventEmitter {
29
30
  this.logWarn = account.log?.warn || false;
30
31
  this.logDebug = account.log?.debug || false;
31
32
  this.contextKey = contextKey;
32
- this.accountName = accountName;
33
- this.deviceId = deviceId;
34
- this.deviceName = deviceName;
35
- this.deviceTypeText = deviceTypeText;
33
+ this.accountName = account.name;
34
+ this.deviceId = device.id;
35
+ this.deviceName = device.name;
36
+ this.deviceTypeText = device.typeString;
36
37
  this.devicesFile = devicesFile;
37
38
  this.displayDeviceInfo = true;
38
39
 
@@ -917,13 +918,7 @@ class DeviceAta extends EventEmitter {
917
918
  async start() {
918
919
  try {
919
920
  //melcloud device
920
- this.melCloudAta = new MelCloudAta({
921
- contextKey: this.contextKey,
922
- devicesFile: this.devicesFile,
923
- deviceId: this.deviceId,
924
- logWarn: this.logWarn,
925
- logDebug: this.logDebug
926
- })
921
+ this.melCloudAta = new MelCloudAta(this.device, his.contextKey, this.devicesFile)
927
922
  .on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
928
923
  if (this.logDeviceInfo && this.displayDeviceInfo) {
929
924
  this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
package/src/deviceatw.js CHANGED
@@ -6,7 +6,7 @@ import { TemperatureDisplayUnits, HeatPump } from './constants.js';
6
6
  let Accessory, Characteristic, Service, Categories, AccessoryUUID;
7
7
 
8
8
  class DeviceAtw extends EventEmitter {
9
- constructor(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, useFahrenheit, restFul, mqtt) {
9
+ constructor(api, account, device, contextKey, devicesFile, useFahrenheit, restFul, mqtt) {
10
10
  super();
11
11
 
12
12
  Accessory = api.platformAccessory;
@@ -16,6 +16,7 @@ class DeviceAtw extends EventEmitter {
16
16
  AccessoryUUID = api.hap.uuid;
17
17
 
18
18
  //account config
19
+ this.device = device;
19
20
  this.displayMode = device.displayMode;
20
21
  this.hideZone = device.hideZone;
21
22
  this.temperatureSensor = device.temperatureSensor || false;
@@ -34,10 +35,10 @@ class DeviceAtw extends EventEmitter {
34
35
  this.logWarn = account.log?.warn || false;
35
36
  this.logDebug = account.log?.debug || false;
36
37
  this.contextKey = contextKey;
37
- this.accountName = accountName;
38
- this.deviceId = deviceId;
39
- this.deviceName = deviceName;
40
- this.deviceTypeText = deviceTypeText;
38
+ this.accountName = account.name;
39
+ this.deviceId = device.id;
40
+ this.deviceName = device.name;
41
+ this.deviceTypeText = device.typeString;
41
42
  this.devicesFile = devicesFile;
42
43
  this.displayDeviceInfo = true;
43
44
 
@@ -1283,13 +1284,7 @@ class DeviceAtw extends EventEmitter {
1283
1284
  async start() {
1284
1285
  try {
1285
1286
  //melcloud device
1286
- this.melCloudAtw = new MelCloudAtw({
1287
- contextKey: this.contextKey,
1288
- devicesFile: this.devicesFile,
1289
- deviceId: this.deviceId,
1290
- logWarn: this.logWarn,
1291
- logDebug: this.logDebug
1292
- })
1287
+ this.melCloudAtw = new MelCloudAtw(this.device, his.contextKey, this.devicesFile)
1293
1288
  .on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion, hasHotWaterTank, hasZone2) => {
1294
1289
  if (this.logDeviceInfo && this.displayDeviceInfo) {
1295
1290
  this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
package/src/deviceerv.js CHANGED
@@ -6,7 +6,7 @@ import { TemperatureDisplayUnits, Ventilation } from './constants.js';
6
6
  let Accessory, Characteristic, Service, Categories, AccessoryUUID;
7
7
 
8
8
  class DeviceErv extends EventEmitter {
9
- constructor(api, account, device, contextKey, accountName, deviceId, deviceName, deviceTypeText, devicesFile, useFahrenheit, restFul, mqtt) {
9
+ constructor(api, account, device, contextKey, devicesFile, useFahrenheit, restFul, mqtt) {
10
10
  super();
11
11
 
12
12
  Accessory = api.platformAccessory;
@@ -16,6 +16,7 @@ class DeviceErv extends EventEmitter {
16
16
  AccessoryUUID = api.hap.uuid;
17
17
 
18
18
  //account config
19
+ this.device = device;
19
20
  this.displayMode = device.displayMode;
20
21
  this.temperatureSensor = device.temperatureSensor || false;
21
22
  this.temperatureSensorOutdoor = device.temperatureSensorOutdoor || false;
@@ -27,10 +28,10 @@ class DeviceErv extends EventEmitter {
27
28
  this.logWarn = account.log?.warn || false;
28
29
  this.logDebug = account.log?.debug || false;
29
30
  this.contextKey = contextKey;
30
- this.accountName = accountName;
31
- this.deviceId = deviceId;
32
- this.deviceName = deviceName;
33
- this.deviceTypeText = deviceTypeText;
31
+ this.accountName = account.name;
32
+ this.deviceId = device.id;
33
+ this.deviceName = device.name;
34
+ this.deviceTypeText = device.typeString;
34
35
  this.devicesFile = devicesFile;
35
36
  this.displayDeviceInfo = true;
36
37
 
@@ -838,13 +839,7 @@ class DeviceErv extends EventEmitter {
838
839
  async start() {
839
840
  try {
840
841
  //melcloud device
841
- this.melCloudErv = new MelCloudErv({
842
- contextKey: this.contextKey,
843
- devicesFile: this.devicesFile,
844
- deviceId: this.deviceId,
845
- logWarn: this.logWarn,
846
- logDebug: this.logDebug
847
- })
842
+ this.melCloudErv = new MelCloudErv(this.device, his.contextKey, this.devicesFile)
848
843
  .on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
849
844
  if (this.logDeviceInfo && this.displayDeviceInfo) {
850
845
  this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
@@ -6,12 +6,12 @@ import Functions from './functions.js';
6
6
  import { ApiUrls } from './constants.js';
7
7
 
8
8
  class MelCloudAta extends EventEmitter {
9
- constructor(config) {
9
+ constructor(device, contextKey, devicesFile) {
10
10
  super();
11
- this.devicesFile = config.devicesFile;
12
- this.deviceId = config.deviceId;
13
- this.logWarn = config.logWarn;
14
- this.logDebug = config.logDebug;
11
+ this.devicesFile = devicesFile;
12
+ this.deviceId = device.id;
13
+ this.logWarn = device.log?.warn;
14
+ this.logDebug = device.log?.debug;
15
15
  this.functions = new Functions();
16
16
 
17
17
  //set default values
@@ -22,7 +22,7 @@ class MelCloudAta extends EventEmitter {
22
22
  baseURL: ApiUrls.BaseURL,
23
23
  timeout: 25000,
24
24
  headers: {
25
- 'X-MitsContextKey': config.contextKey,
25
+ 'X-MitsContextKey': contextKey,
26
26
  'content-type': 'application/json'
27
27
  },
28
28
  withCredentials: true,
@@ -6,12 +6,12 @@ import Functions from './functions.js';
6
6
  import { ApiUrls } from './constants.js';
7
7
 
8
8
  class MelCloudAtw extends EventEmitter {
9
- constructor(config) {
9
+ constructor(device, contextKey, devicesFile) {
10
10
  super();
11
- this.devicesFile = config.devicesFile;
12
- this.deviceId = config.deviceId;
13
- this.logWarn = config.logWarn;
14
- this.logDebug = config.logDebug;
11
+ this.devicesFile = devicesFile;
12
+ this.deviceId = device.id;
13
+ this.logWarn = device.log?.warn;
14
+ this.logDebug = device.log?.debug;
15
15
  this.functions = new Functions();
16
16
 
17
17
  //set default values
@@ -22,7 +22,7 @@ class MelCloudAtw extends EventEmitter {
22
22
  baseURL: ApiUrls.BaseURL,
23
23
  timeout: 25000,
24
24
  headers: {
25
- 'X-MitsContextKey': config.contextKey,
25
+ 'X-MitsContextKey': contextKey,
26
26
  'content-type': 'application/json'
27
27
  },
28
28
  withCredentials: true,
@@ -6,12 +6,12 @@ import Functions from './functions.js';
6
6
  import { ApiUrls } from './constants.js';
7
7
 
8
8
  class MelCloudErv extends EventEmitter {
9
- constructor(config) {
9
+ constructor(device, contextKey, devicesFile) {
10
10
  super();
11
- this.devicesFile = config.devicesFile;
12
- this.deviceId = config.deviceId;
13
- this.logWarn = config.logWarn;
14
- this.logDebug = config.logDebug;
11
+ this.devicesFile = devicesFile;
12
+ this.deviceId = device.id;
13
+ this.logWarn = device.log?.warn;
14
+ this.logDebug = device.log?.debug;
15
15
  this.functions = new Functions();
16
16
 
17
17
  //set default values
@@ -22,7 +22,7 @@ class MelCloudErv extends EventEmitter {
22
22
  baseURL: ApiUrls.BaseURL,
23
23
  timeout: 25000,
24
24
  headers: {
25
- 'X-MitsContextKey': config.contextKey,
25
+ 'X-MitsContextKey': contextKey,
26
26
  'content-type': 'application/json'
27
27
  },
28
28
  withCredentials: true,