homebridge-melcloud-control 4.2.5-beta.3 → 4.2.5-beta.4

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.2.5-beta.3",
4
+ "version": "4.2.5-beta.4",
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/deviceatw.js CHANGED
@@ -1378,9 +1378,6 @@ class DeviceAtw extends EventEmitter {
1378
1378
  //get button mode
1379
1379
  const mode = button.mode;
1380
1380
 
1381
- //get button display type
1382
- const displayType = button.displayType;
1383
-
1384
1381
  //get button name
1385
1382
  const name = button.name;
1386
1383
 
@@ -1394,10 +1391,10 @@ class DeviceAtw extends EventEmitter {
1394
1391
  //control
1395
1392
  if (button.displayType > 3) {
1396
1393
  if (this.logDebug) this.emit('debug', `Prepare button control ${name} service`);
1397
- const buttonControlService = new serviceType(serviceName, `buttonControlService${deviceId} ${i}`);
1394
+ const buttonControlService = new serviceType(serviceName1, `buttonControlService${deviceId} ${i}`);
1398
1395
  buttonControlService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1399
1396
  buttonControlService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
1400
- buttonControlService.getCharacteristic(characteristicType)
1397
+ buttonControlService.getCharacteristic(Characteristic.On)
1401
1398
  .onGet(async () => {
1402
1399
  const state = button.state;
1403
1400
  return state;
@@ -1552,9 +1549,9 @@ class DeviceAtw extends EventEmitter {
1552
1549
 
1553
1550
  //sensor
1554
1551
  if (this.logDebug) this.emit('debug', `Prepare button control sensor ${name} service`);
1555
- const buttonControlSensorService = new serviceType(serviceName, `buttonControlSensorService${deviceId} ${i}`);
1552
+ const buttonControlSensorService = new serviceType(serviceName1, `buttonControlSensorService${deviceId} ${i}`);
1556
1553
  buttonControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1557
- buttonControlSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
1554
+ buttonControlSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
1558
1555
  buttonControlSensorService.getCharacteristic(characteristicType)
1559
1556
  .onGet(async () => {
1560
1557
  const state = button.state;
package/src/deviceerv.js CHANGED
@@ -983,12 +983,12 @@ class DeviceErv extends EventEmitter {
983
983
  const mode = button.mode;
984
984
 
985
985
  //get button name
986
- const buttonName = button.name;
986
+ const name = button.name;
987
987
 
988
988
  //get button name prefix
989
989
  const namePrefix = button.namePrefix;
990
990
 
991
- const serviceName1 = namePrefix ? `${accessoryName} ${buttonName}` : buttonName;
991
+ const serviceName1 = namePrefix ? `${accessoryName} ${name}` : name;
992
992
  const serviceType = button.serviceType;
993
993
  const characteristicType = button.characteristicType;
994
994
 
@@ -1082,7 +1082,7 @@ class DeviceErv extends EventEmitter {
1082
1082
  break;
1083
1083
  };
1084
1084
 
1085
- if (this.logInfo) this.emit('info', `${state ? `Set: ${buttonName}` : `Unset: ${buttonName}, Set: ${button.previousValue}`}`);
1085
+ if (this.logInfo) this.emit('info', `${state ? `Set: ${name}` : `Unset: ${name}, Set: ${button.previousValue}`}`);
1086
1086
  await this.melCloudErv.send(this.accountType, this.displayType, deviceData, flag);
1087
1087
  } catch (error) {
1088
1088
  if (this.logWarn) this.emit('warn', `Set button error: ${error}`);
@@ -1094,9 +1094,9 @@ class DeviceErv extends EventEmitter {
1094
1094
 
1095
1095
  //sensor
1096
1096
  if (this.logDebug) this.emit('debug', `Prepare button control sensor ${name} service`);
1097
- const buttonControlSensorService = new serviceType(serviceName, `buttonControlSensorService${deviceId} ${i}`);
1097
+ const buttonControlSensorService = new serviceType(serviceName1, `buttonControlSensorService${deviceId} ${i}`);
1098
1098
  buttonControlSensorService.addOptionalCharacteristic(Characteristic.ConfiguredName);
1099
- buttonControlSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceName);
1099
+ buttonControlSensorService.setCharacteristic(Characteristic.ConfiguredName, serviceName1);
1100
1100
  buttonControlSensorService.getCharacteristic(characteristicType)
1101
1101
  .onGet(async () => {
1102
1102
  const state = button.state;