homebridge-melcloud-control 4.3.0-beta.44 → 4.3.0-beta.45

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.3.0-beta.44",
4
+ "version": "4.3.0-beta.45",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -136,7 +136,9 @@ class MelCloudAta extends EventEmitter {
136
136
  })
137
137
  .on('message', (message) => {
138
138
  const parsedMessage = JSON.parse(message);
139
- if (!this.logDebug) this.emit('warn', `Incoming message: ${JSON.stringify(parsedMessage, null, 2)}`);
139
+ const stringifyMessage = JSON.stringify(parsedMessage, null, 2);
140
+ if (this.logDebug) this.emit('warn', `Incoming message: ${stringifyMessage}`);
141
+ if (parsedMessage.message === 'Forbidden') return;
140
142
 
141
143
  const messageData = parsedMessage?.[0]?.Data;
142
144
  const unitId = messageData?.id;
@@ -164,12 +166,12 @@ class MelCloudAta extends EventEmitter {
164
166
  this.emit('deviceState', deviceData);
165
167
  break;
166
168
  default:
167
- if (this.logWarn) this.emit('warn', `Incoming unknown message type: ${messageType}`);
169
+ if (this.logWarn) this.emit('warn', `Unit ${unitId}, received unknown message type: ${stringifyMessage}`);
168
170
  return;
169
171
  }
170
172
  break;
171
173
  default:
172
- if (this.logWarn) this.emit('warn', `Incoming unknown unit id: ${unitId}`);
174
+ if (this.logWarn) this.emit('warn', `Incoming unknown unit id: ${stringifyMessage}`);
173
175
  return;
174
176
  }
175
177
  });