homebridge-melcloud-control 2.3.0-beta.5 → 2.3.0-beta.7

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
@@ -210,5 +210,23 @@ class MelCloudPlatform {
210
210
  };
211
211
 
212
212
  module.exports = (api) => {
213
+ const { Service, Characteristic, Units, Formats, Perms } = api.hap;
214
+ //custom characteristics
215
+ class CustomTargetHeaterCoolerState extends Characteristic {
216
+ constructor() {
217
+ super('Mode', '00000033-0000-1000-8000-0026BB765291');
218
+ this.setProps({
219
+ format: Formats.UINT8,
220
+ minValue: 0,
221
+ maxValue: 3,
222
+ minStep: 1,
223
+ validValues: [0, 1, 2, 3],
224
+ perms: [Perms.NOTIFY, Perms.PAIRED_READ, Perms.PAIRED_WRITE]
225
+ });
226
+ this.value = this.getDefaultValue();
227
+ }
228
+ }
229
+ Characteristic.CustomTargetHeaterCoolerState = CustomTargetHeaterCoolerState;
230
+
213
231
  api.registerPlatform(CONSTANTS.PluginName, CONSTANTS.PlatformName, MelCloudPlatform, true);
214
232
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "2.3.0-beta.5",
4
+ "version": "2.3.0-beta.7",
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
@@ -631,7 +631,9 @@ class DeviceAta extends EventEmitter {
631
631
  switch (displayMode) {
632
632
  case 0: //Heater Cooler
633
633
  const debug = this.enableDebugMode ? this.emit('debug', `Prepare heather/cooler service`) : false;
634
- this.melCloudService = new Service.HeaterCooler(serviceName, `HeaterCooler ${deviceId}`);
634
+ this.melCloudService = accessory.addService(Service.HeaterCooler, serviceName, `HeaterCooler ${deviceId}`);
635
+ this.melCloudService.removeCharacteristic(Characteristic.CustomTargetHeaterCoolerState);
636
+ this.melCloudService.addCharacteristic(Characteristic.CustomTargetHeaterCoolerState);
635
637
  this.melCloudService.getCharacteristic(Characteristic.Active)
636
638
  .onGet(async () => {
637
639
  const state = this.power;
@@ -653,7 +655,7 @@ class DeviceAta extends EventEmitter {
653
655
  const value = this.currentOperationMode;
654
656
  return value;
655
657
  });
656
- this.melCloudService.getCharacteristic(Characteristic.TargetHeaterCoolerState)
658
+ this.melCloudService.getCharacteristic(Characteristic.CustomTargetHeaterCoolerState)
657
659
  .setProps({
658
660
  minValue: this.operationModeSetPropsMinValue,
659
661
  maxValue: this.operationModeSetPropsMaxValue,
@@ -839,7 +841,6 @@ class DeviceAta extends EventEmitter {
839
841
  this.emit('warn', `Set temperature display unit error: ${error}`);
840
842
  };
841
843
  });
842
- accessory.addService(this.melCloudService);
843
844
  break;
844
845
  case 1: //Thermostat
845
846
  const debug1 = this.enableDebugMode ? this.emit('debug', `Prepare thermostat service`) : false;