homebridge-melcloud-control 4.0.0-beta.193 → 4.0.0-beta.195

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
@@ -79,8 +79,6 @@ class MelCloudPlatform {
79
79
  const accountFile = `${prefDir}/${accountName}_Account`;
80
80
  const buildingsFile = `${prefDir}/${accountName}_Buildings`;
81
81
  const devicesFile = `${prefDir}/${accountName}_Devices`;
82
- const defaultTempsFile = `${prefDir}/${accountName}_Temps`;
83
-
84
82
 
85
83
  //set account refresh interval
86
84
  const refreshInterval = (account.refreshInterval ?? 120) * 1000
@@ -143,6 +141,7 @@ class MelCloudPlatform {
143
141
  const deviceType = device.type;
144
142
  const deviceTypeText = device.typeString;
145
143
  const deviceRefreshInterval = (device.refreshInterval ?? 5) * 1000;
144
+ const defaultTempsFile = `${prefDir}/${accountName}_${device.id}_Temps`;
146
145
 
147
146
  let configuredDevice;
148
147
  switch (deviceType) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.193",
4
+ "version": "4.0.0-beta.195",
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
@@ -923,7 +923,7 @@ class DeviceAta extends EventEmitter {
923
923
  async start() {
924
924
  try {
925
925
  //melcloud device
926
- this.melCloudAta = new MelCloudAta(this.account, this.device, this.devicesFile, this.defaultTempsFile)
926
+ this.melCloudAta = new MelCloudAta(this.account, this.device, this.devicesFile, this.defaultTempsFile)
927
927
  .on('deviceInfo', (manufacturer, modelIndoor, modelOutdoor, serialNumber, firmwareAppVersion) => {
928
928
  if (this.logDeviceInfo && this.displayDeviceInfo) {
929
929
  this.emit('devInfo', `---- ${this.deviceTypeText}: ${this.deviceName} ----`);
@@ -289,14 +289,6 @@ class MelCloudAta extends EventEmitter {
289
289
  return;
290
290
  };
291
291
 
292
- if (this.deviceState.DefaultCoolingSetTemperature !== deviceData.Device.DefaultCoolingSetTemperature || this.deviceState.DefaultHeatingSetTemperature !== deviceData.Device.DefaultHeatingSetTemperature) {
293
- const temps = {
294
- defaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature,
295
- defaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature
296
- };
297
- await this.functions.saveData(this.defaultTempsFile, temps);
298
- }
299
-
300
292
  break
301
293
  case 2: //Thermostat
302
294
  deviceData.Device.SetTemperature = deviceData.Device.SetTemperature;
@@ -306,6 +298,15 @@ class MelCloudAta extends EventEmitter {
306
298
  return;
307
299
  };
308
300
 
301
+ if (this.deviceState.SetTemperature !== deviceData.Device.SetTemperature || this.deviceState.DefaultCoolingSetTemperature !== deviceData.Device.DefaultCoolingSetTemperature || this.deviceState.DefaultHeatingSetTemperature !== deviceData.Device.DefaultHeatingSetTemperature) {
302
+ const temps = {
303
+ setTemperature: deviceData.Device.SetTemperature,
304
+ defaultCoolingSetTemperature: deviceData.Device.DefaultCoolingSetTemperature,
305
+ defaultHeatingSetTemperature: deviceData.Device.DefaultHeatingSetTemperature
306
+ };
307
+ await this.functions.saveData(this.defaultTempsFile, temps);
308
+ }
309
+
309
310
  const settings = {
310
311
  data: {
311
312
  Power: deviceData.Device.Power,