diff --git a/package.json b/package.json index 418f4c3..72ad66b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "MELCloud Control", "name": "homebridge-melcloud-control", - "version": "3.0.5", + "version": "3.0.6", "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.", "license": "MIT", "author": "grzegorz914", diff --git a/src/deviceata.js b/src/deviceata.js index 326335b..4c89948 100644 --- a/src/deviceata.js +++ b/src/deviceata.js @@ -62,6 +62,9 @@ class DeviceAta extends EventEmitter { //accessory this.startPrepareAccessory = true; this.accessory = {}; + this.accessory.currentOperationMode = 0; + this.accessory.targetOperationMode = 0; + this.accessory.fanSpeed = 0; //melcloud device this.melCloudAta = new MelCloudAta({ @@ -189,7 +192,7 @@ class DeviceAta extends EventEmitter { const vaneVertical = deviceState.VaneVertical; const hideVaneControls = deviceState.HideVaneControls; const hideDryModeControl = deviceState.HideDryModeControl; - const inStandbyMode = deviceData.Device.InStandbyMode; + const inStandbyMode = deviceState.InStandbyMode; const prohibitSetTemperature = deviceState.ProhibitSetTemperature; const prohibitOperationMode = deviceState.ProhibitOperationMode; const prohibitPower = deviceState.ProhibitPower; @@ -205,10 +208,7 @@ class DeviceAta extends EventEmitter { this.accessory.roomTemperature = roomTemperature; this.accessory.outdoorTemperature = outdoorTemperature; this.accessory.setTemperature = setTemperature; - this.accessory.fanSpeed = 0; this.accessory.setFanSpeed = setFanSpeed; - this.accessory.currentOperationMode = 0; - this.accessory.targetOperationMode = 0; this.accessory.vaneHorizontal = vaneHorizontal; this.accessory.vaneVertical = vaneVertical; this.accessory.swingMode = swingFunction && vaneHorizontal === 12 && vaneVertical === 7 ? 1 : 0; @@ -336,7 +336,7 @@ class DeviceAta extends EventEmitter { case true: switch (operationMode) { case 1: //HEAT - this.accessory.currentOperationMode = 1; //OFF, HEAT, COOL + this.accessory.currentOperationMode = 1; //OFF, HEAT, COOL this.accessory.targetOperationMode = 1; //OFF, HEAT, COOL, AUTO break; case 2: //DRY diff --git a/src/deviceerv.js b/src/deviceerv.js index 6b22ded..d94354b 100644 --- a/src/deviceerv.js +++ b/src/deviceerv.js @@ -60,6 +60,10 @@ class DeviceErv extends EventEmitter { //accessory this.startPrepareAccessory = true; this.accessory = {}; + this.accessory.currentOperationMode = 0; + this.accessory.targetOperationMode = 0; + this.accessory.fanSpeed = 0; + this.accessory.lockPhysicalControl = 0; //melcloud device this.melCloudErv = new MelCloudErv({ @@ -216,14 +220,10 @@ class DeviceErv extends EventEmitter { this.accessory.outdoorTemperature = outdoorTemperature; this.accessory.supplyTemperature = supplyTemperature; this.accessory.setTemperature = targetTemperature; - this.accessory.fanSpeed = 0; this.accessory.setFanSpeed = setFanSpeed; - this.accessory.currentOperationMode = 0; - this.accessory.targetOperationMode = 0; this.accessory.temperatureIncrement = temperatureIncrement; this.accessory.useFahrenheit = useFahrenheit; this.accessory.temperatureUnit = temperatureUnit; - this.accessory.lockPhysicalControl = 0; this.accessory.hasAutomaticFanSpeed = hasAutomaticFanSpeed; this.accessory.hasOutdoorTemperature = hasOutdoorTemperature; this.accessory.numberOfFanSpeeds = numberOfFanSpeeds;