homebridge-melcloud-control 4.3.0-beta.55 → 4.3.0-beta.57

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
@@ -85,12 +85,12 @@ class MelCloudPlatform {
85
85
  .on('start', async () => {
86
86
  try {
87
87
  //melcloud account
88
- const melCloud = account.type === 'melcloud' ? new MelCloud(account, accountFile, buildingsFile, devicesFile, true) : new MelCloudHome(account, accountFile, buildingsFile, devicesFile, true);
89
- melCloud.on('success', (msg) => logLevel.success && log.success(`${accountName}, ${msg}`))
90
- .on('info', (msg) => logLevel.info && log.info(`${accountName}, ${msg}`))
91
- .on('debug', (msg) => logLevel.debug && log.info(`${accountName}, debug: ${msg}`))
92
- .on('warn', (msg) => logLevel.warn && log.warn(`${accountName}, ${msg}`))
93
- .on('error', (msg) => logLevel.error && log.error(`${accountName}, ${msg}`));
88
+ const melCloud = account.type === 'melcloud' ? new MelCloud(account, accountFile, buildingsFile, devicesFile, true) : new MelCloudHome(account, accountFile, buildingsFile, devicesFile, true)
89
+ .on('success', (msg) => log.success(`${accountName}, ${msg}`))
90
+ .on('info', (msg) => log.info(`${accountName}, ${msg}`))
91
+ .on('debug', (msg) => log.info(`${accountName}, debug: ${msg}`))
92
+ .on('warn', (msg) => log.warn(`${accountName}, ${msg}`))
93
+ .on('error', (msg) => log.error(`${accountName}, ${msg}`));
94
94
 
95
95
  //connect
96
96
  let accountInfo;
@@ -181,11 +181,11 @@ class MelCloudPlatform {
181
181
  }
182
182
 
183
183
  configuredDevice.on('devInfo', (info) => logLevel.devInfo && log.info(info))
184
- .on('success', (msg) => logLevel.success && log.success(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`))
185
- .on('info', (msg) => logLevel.info && log.info(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`))
186
- .on('debug', (msg) => logLevel.debug && log.info(`${accountName}, ${deviceTypeString}, ${deviceName}, debug: ${msg}`))
187
- .on('warn', (msg) => logLevel.warn && log.warn(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`))
188
- .on('error', (msg) => logLevel.error && log.error(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`));
184
+ .on('success', (msg) => log.success(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`))
185
+ .on('info', (msg) => log.info(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`))
186
+ .on('debug', (msg) => log.info(`${accountName}, ${deviceTypeString}, ${deviceName}, debug: ${msg}`))
187
+ .on('warn', (msg) => log.warn(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`))
188
+ .on('error', (msg) => log.error(`${accountName}, ${deviceTypeString}, ${deviceName}, ${msg}`));
189
189
 
190
190
  const accessory = await configuredDevice.start();
191
191
  if (accessory) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.3.0-beta.55",
4
+ "version": "4.3.0-beta.57",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -103,7 +103,7 @@ class MelCloudAta extends EventEmitter {
103
103
  socket.close();
104
104
  })
105
105
  .on('close', () => {
106
- if (this.logDebug) this.emit('debug', `Socket closed`);
106
+ if (!this.logDebug) this.emit('debug', `Socket closed`);
107
107
  this.cleanupSocket();
108
108
  })
109
109
  .on('open', () => {
@@ -115,7 +115,7 @@ class MelCloudAta extends EventEmitter {
115
115
  // heartbeat
116
116
  this.heartbeat = setInterval(() => {
117
117
  if (socket.readyState === socket.OPEN) {
118
- if (!this.logDebug) this.emit('warn', `Socket send heartbeat`);
118
+ if (!this.logDebug) this.emit('debug', `Socket send heartbeat`);
119
119
  socket.ping();
120
120
  }
121
121
  }, 30000);
@@ -156,12 +156,12 @@ class MelCloudAta extends EventEmitter {
156
156
  updateDeviceState = true;
157
157
  break;
158
158
  default:
159
- if (this.logWarn) this.emit('warn', `Unit ${unitId}, received unknown message type: ${stringifyMessage}`);
159
+ if (!this.logDebug) this.emit('debug', `Unit ${unitId}, received unknown message type: ${stringifyMessage}`);
160
160
  return;
161
161
  }
162
162
  break;
163
163
  default:
164
- if (this.logWarn) this.emit('warn', `Incoming unknown unit id: ${stringifyMessage}`);
164
+ if (!this.logDebug) this.emit('debug', `Incoming unknown unit id: ${stringifyMessage}`);
165
165
  return;
166
166
  }
167
167