homebridge-melcloud-control 3.8.4-beta.7 → 3.8.5-beta.0

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.
@@ -1764,7 +1764,7 @@
1764
1764
  "prefix": {
1765
1765
  "title": "Prefix",
1766
1766
  "type": "string",
1767
- "placeholder": "home/envoy",
1767
+ "placeholder": "home/melcloud",
1768
1768
  "description": "Here set the prefix.",
1769
1769
  "condition": {
1770
1770
  "functionBody": "return model.accounts[arrayIndices].mqtt.enable === true;"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "3.8.4-beta.7",
4
+ "version": "3.8.5-beta.0",
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
@@ -114,8 +114,11 @@ class DeviceAta extends EventEmitter {
114
114
  .on('debug', (debug) => {
115
115
  this.emit('debug', debug);
116
116
  })
117
+ .on('warn', (warn) => {
118
+ this.emit('warn', warn);
119
+ })
117
120
  .on('error', (error) => {
118
- this.emit('warn', error);
121
+ this.emit('error', error);
119
122
  });
120
123
  }
121
124
  }
@@ -127,8 +130,8 @@ class DeviceAta extends EventEmitter {
127
130
  this.mqtt1 = new Mqtt({
128
131
  host: this.mqtt.host,
129
132
  port: this.mqtt.port || 1883,
130
- clientId: `${this.mqtt.clientId}_${this.deviceId}` || `${this.deviceTypeText}_${this.deviceName}_${this.deviceId}`,
131
- prefix: `${this.mqtt.prefix}/${this.deviceTypeText}/${this.deviceName}`,
133
+ clientId: this.mqtt.clientId ? `${this.mqtt.clientId}_${this.deviceId}` : `${this.deviceTypeText}_${this.deviceName}_${this.deviceId}`,
134
+ prefix: this.mqtt.prefix ? `${this.mqtt.prefix}/${this.deviceTypeText}/${this.deviceName}` : `melcloud/${this.deviceTypeText}/${this.deviceName}`,
132
135
  user: this.mqtt.user,
133
136
  passwd: this.mqtt.pass,
134
137
  debug: this.mqtt.debug || false
@@ -151,8 +154,11 @@ class DeviceAta extends EventEmitter {
151
154
  .on('debug', (debug) => {
152
155
  this.emit('debug', debug);
153
156
  })
157
+ .on('warn', (warn) => {
158
+ this.emit('warn', warn);
159
+ })
154
160
  .on('error', (error) => {
155
- this.emit('warn', error);
161
+ this.emit('error', error);
156
162
  });
157
163
  }
158
164
  }
@@ -1091,7 +1097,6 @@ class DeviceAta extends EventEmitter {
1091
1097
  };
1092
1098
 
1093
1099
  obj.currentOperationMode = !power ? 0 : inStandbyMode ? 1 : obj.currentOperationMode;
1094
- obj.targetOperationMode = obj.targetOperationMode;
1095
1100
  obj.operationModeSetPropsMinValue = modelSupportsAuto && modelSupportsHeat ? 0 : !modelSupportsAuto && modelSupportsHeat ? 1 : modelSupportsAuto && !modelSupportsHeat ? 0 : 2;
1096
1101
  obj.operationModeSetPropsMaxValue = 2
1097
1102
  obj.operationModeSetPropsValidValues = modelSupportsAuto && modelSupportsHeat ? [0, 1, 2] : !modelSupportsAuto && modelSupportsHeat ? [1, 2] : modelSupportsAuto && !modelSupportsHeat ? [0, 2] : [2];
package/src/deviceatw.js CHANGED
@@ -120,8 +120,11 @@ class DeviceAtw extends EventEmitter {
120
120
  .on('debug', (debug) => {
121
121
  this.emit('debug', debug);
122
122
  })
123
+ .on('warn', (warn) => {
124
+ this.emit('warn', warn);
125
+ })
123
126
  .on('error', (error) => {
124
- this.emit('warn', error);
127
+ this.emit('error', error);
125
128
  });
126
129
  }
127
130
  }
@@ -133,8 +136,8 @@ class DeviceAtw extends EventEmitter {
133
136
  this.mqtt1 = new Mqtt({
134
137
  host: this.mqtt.host,
135
138
  port: this.mqtt.port || 1883,
136
- clientId: `${this.mqtt.clientId}_${this.deviceId}` || `${this.deviceTypeText}_${this.deviceName}_${this.deviceId}`,
137
- prefix: `${this.mqtt.prefix}/${this.deviceTypeText}/${this.deviceName}`,
139
+ clientId: this.mqtt.clientId ? `${this.mqtt.clientId}_${this.deviceId}` : `${this.deviceTypeText}_${this.deviceName}_${this.deviceId}`,
140
+ prefix: this.mqtt.prefix ? `${this.mqtt.prefix}/${this.deviceTypeText}/${this.deviceName}` : `melcloud/${this.deviceTypeText}/${this.deviceName}`,
138
141
  user: this.mqtt.user,
139
142
  passwd: this.mqtt.pass,
140
143
  debug: this.mqtt.debug || false
@@ -157,8 +160,11 @@ class DeviceAtw extends EventEmitter {
157
160
  .on('debug', (debug) => {
158
161
  this.emit('debug', debug);
159
162
  })
163
+ .on('warn', (warn) => {
164
+ this.emit('warn', warn);
165
+ })
160
166
  .on('error', (error) => {
161
- this.emit('warn', error);
167
+ this.emit('error', error);
162
168
  });
163
169
  }
164
170
  }
package/src/deviceerv.js CHANGED
@@ -113,8 +113,11 @@ class DeviceErv extends EventEmitter {
113
113
  .on('debug', (debug) => {
114
114
  this.emit('debug', debug);
115
115
  })
116
+ .on('warn', (warn) => {
117
+ this.emit('warn', warn);
118
+ })
116
119
  .on('error', (error) => {
117
- this.emit('warn', error);
120
+ this.emit('error', error);
118
121
  });
119
122
  }
120
123
  }
@@ -126,8 +129,8 @@ class DeviceErv extends EventEmitter {
126
129
  this.mqtt1 = new Mqtt({
127
130
  host: this.mqtt.host,
128
131
  port: this.mqtt.port || 1883,
129
- clientId: `${this.mqtt.clientId}_${this.deviceId}` || `${this.deviceTypeText}_${this.deviceName}_${this.deviceId}`,
130
- prefix: `${this.mqtt.prefix}/${this.deviceTypeText}/${this.deviceName}`,
132
+ clientId: this.mqtt.clientId ? `${this.mqtt.clientId}_${this.deviceId}` : `${this.deviceTypeText}_${this.deviceName}_${this.deviceId}`,
133
+ prefix: this.mqtt.prefix ? `${this.mqtt.prefix}/${this.deviceTypeText}/${this.deviceName}` : `melcloud/${this.deviceTypeText}/${this.deviceName}`,
131
134
  user: this.mqtt.user,
132
135
  passwd: this.mqtt.pass,
133
136
  debug: this.mqtt.debug || false
@@ -150,8 +153,11 @@ class DeviceErv extends EventEmitter {
150
153
  .on('debug', (debug) => {
151
154
  this.emit('debug', debug);
152
155
  })
156
+ .on('warn', (warn) => {
157
+ this.emit('warn', warn);
158
+ })
153
159
  .on('error', (error) => {
154
- this.emit('warn', error);
160
+ this.emit('error', error);
155
161
  });
156
162
  }
157
163
  }
@@ -336,6 +336,7 @@ class MelCloudAta extends EventEmitter {
336
336
  //check state changes
337
337
  const deviceDataHasNotChanged = JSON.stringify(deviceState) === JSON.stringify(this.deviceState);
338
338
  if (deviceDataHasNotChanged) {
339
+ const debug = this.enableDebugMode ? this.emit('debug', `Device state not changed`) : false;
339
340
  return;
340
341
  }
341
342
  this.deviceState = deviceState;
@@ -400,6 +400,7 @@ class MelCloudAtw extends EventEmitter {
400
400
  //check state changes
401
401
  const deviceDataHasNotChanged = JSON.stringify(deviceState) === JSON.stringify(this.deviceState);
402
402
  if (deviceDataHasNotChanged) {
403
+ const debug = this.enableDebugMode ? this.emit('debug', `Device state not changed`) : false;
403
404
  return;
404
405
  }
405
406
  this.deviceState = deviceState;
@@ -324,6 +324,7 @@ class MelCloudErv extends EventEmitter {
324
324
  //check state changes
325
325
  const deviceDataHasNotChanged = JSON.stringify(deviceState) === JSON.stringify(this.deviceState);
326
326
  if (deviceDataHasNotChanged) {
327
+ const debug = this.enableDebugMode ? this.emit('debug', `Device state not changed`) : false;
327
328
  return;
328
329
  }
329
330
  this.deviceState = deviceState;