From 0dcdd7d105b1f8a19108d1c6d5c4d44aecfdf577 Mon Sep 17 00:00:00 2001 From: Cameron <32912464+kiwi-cam@users.noreply.github.com> Date: Wed, 16 Jun 2021 21:10:52 +1200 Subject: [PATCH] Heater cooler updates status based on mode #229 --- CHANGELOG.md | 1 + accessories/heater-cooler.js | 19 ++++++++----------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7905a416..50799775 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed - Improved default allowResend logic when using preventResendHex + - Heater-Cooler now shows as Heating or Cooling depending on mode selected ### Fixed - Fixed characteristic 'Current Temperature': characteristic was supplied illegal value when a heater-cooler reads below 10 - Fixed name not defined error when using oscillate in Heater Cooler diff --git a/accessories/heater-cooler.js b/accessories/heater-cooler.js index d0af8015..c3c78a94 100644 --- a/accessories/heater-cooler.js +++ b/accessories/heater-cooler.js @@ -432,17 +432,14 @@ class HeaterCoolerAccessory extends BroadlinkRMAccessory { // Update homebridge and home app state to reflect the cached state of all the available // characteristics. This ensures that UI for osciallte, fan speed, etc in the app are in // sync with device settings - if (requestedValue === Characteristic.Active.INACTIVE) { - this.updateServiceCurrentHeaterCoolerState(Characteristic.CurrentHeaterCoolerState.INACTIVE) - } else { - if (available.swingMode) { - this.serviceManager.getCharacteristic(Characteristic.SwingMode) - .updateValue(state.swingMode) - } - if (available.rotationSpeed) { - this.serviceManager.getCharacteristic(Characteristic.RotationSpeed) - .updateValue(state.rotationSpeed) - } + this.updateServiceCurrentHeaterCoolerState(); + if (available.swingMode) { + this.serviceManager.getCharacteristic(Characteristic.SwingMode) + .updateValue(state.swingMode) + } + if (available.rotationSpeed) { + this.serviceManager.getCharacteristic(Characteristic.RotationSpeed) + .updateValue(state.rotationSpeed) } }