From 846d43c96229a1069bf31af6fa9aa3878fbdf8a2 Mon Sep 17 00:00:00 2001 From: Cameron <32912464+kiwi-cam@users.noreply.github.com> Date: Thu, 8 Aug 2024 08:34:19 +1200 Subject: [PATCH] 4.4.18 release (#723) Removed use of Characteristic.getValue() in preparation for homebridge 2.0 (4384f7b) Added ping state change logging for troubleshooting (c5a49c2) --- CHANGELOG.md | 7 +++++++ accessories/aircon.js | 2 +- accessories/humidifier-dehumidifier.js | 2 +- accessories/switch.js | 6 ++++-- helpers/serviceManager.js | 4 ++-- package-lock.json | 22 ++++++++++++---------- package.json | 6 +++--- 7 files changed, 30 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6675b18..90343081 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [4.4.18 - 2024-08-08] +### Added + - Added ping state change logging for troubleshooting +### Changed + - Removed use of Characteristic.getValue() in preparation of homebridge 2.0 (#722) + - The removal of getValue() has stopped the regular getCurrentTemperature and getCurrentHumidity calls. Changed the regualar updates to make these calls instead of just using refreshCharacteristic. (#722) + ## [4.4.17 - 2024-07-17] ### Added - Adds support for RM3 Mini 0x27d0 (#691) diff --git a/accessories/aircon.js b/accessories/aircon.js index a4bd6ab0..c338fe0e 100755 --- a/accessories/aircon.js +++ b/accessories/aircon.js @@ -423,7 +423,7 @@ class AirConAccessory extends BroadlinkRMAccessory { device.checkTemperature(); this.updateTemperatureUI(); - if (!config.isUnitTest) {setInterval(this.updateTemperatureUI.bind(this), config.temperatureUpdateFrequency * 1000)} + if (!config.isUnitTest) {setInterval(()=>{this.getCurrentTemperature(this.updateTemperatureUI.bind(this))}, config.temperatureUpdateFrequency * 1000)} } onTemperature (temperature,humidity) { diff --git a/accessories/humidifier-dehumidifier.js b/accessories/humidifier-dehumidifier.js index c44e95b1..cb2d713e 100755 --- a/accessories/humidifier-dehumidifier.js +++ b/accessories/humidifier-dehumidifier.js @@ -202,7 +202,7 @@ class HumidifierDehumidifierAccessory extends FanAccessory { device.checkHumidity(); this.updateHumidityUI(); - if (!config.isUnitTest && !config.noHumidity) {setInterval(this.updateHumidityUI.bind(this), config.humidityUpdateFrequency * 1000)} + if (!config.isUnitTest && !config.noHumidity) {setInterval(()=>{this.getCurrentHumidity(this.updateHumidityUI.bind(this))}, config.humidityUpdateFrequency * 1000)} } onHumidity (temperature,humidity) { diff --git a/accessories/switch.js b/accessories/switch.js index 5b93f5d4..bc5c863c 100755 --- a/accessories/switch.js +++ b/accessories/switch.js @@ -90,12 +90,14 @@ class SwitchAccessory extends BroadlinkRMAccessory { } pingCallback (active) { - const { config, state, serviceManager } = this; + const { config, state, serviceManager, name, log, logLevel } = this; if (this.stateChangeInProgress){ return; } - + + if (state.switchState !== active && logLevel <=2){log(`\x1b[35m[INFO]\x1b[0m ${name} ping detected state change, now ${active}`);} + if (config.pingIPAddressStateOnly) { state.switchState = active ? true : false; serviceManager.refreshCharacteristicUI(Characteristic.On); diff --git a/helpers/serviceManager.js b/helpers/serviceManager.js index a74f1238..6ba13109 100755 --- a/helpers/serviceManager.js +++ b/helpers/serviceManager.js @@ -24,7 +24,7 @@ class ServiceManager { } refreshCharacteristicUI (characteristic) { - this.getCharacteristic(characteristic).getValue(); + this.getCharacteristic(characteristic).value; } // Convenience @@ -76,4 +76,4 @@ class ServiceManager { } } -module.exports = ServiceManager \ No newline at end of file +module.exports = ServiceManager diff --git a/package-lock.json b/package-lock.json index 2b23c65b..98e53da7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,21 @@ { "name": "homebridge-broadlink-rm-pro", - "version": "4.4.17", + "version": "4.4.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "homebridge-broadlink-rm-pro", - "version": "4.4.17", + "version": "4.4.18", "license": "ISC", "dependencies": { "await-semaphore": "^0.1.3", "chai": "^4.3.7", - "fakegato-history": "^0.6.4", + "fakegato-history": "^0.6.5", "find-key": "^2.1.3", "github-version-checker": "^2.3.0", "kiwicam-broadlinkjs-rm": "^0.9.22", - "mqtt": "^5.8.0", + "mqtt": "^5.8.1", "node-arp": "^1.0.6", "node-persist": ">=2.1.0 <3.0.0", "ping": "^0.4.4", @@ -2239,9 +2239,10 @@ } }, "node_modules/fakegato-history": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/fakegato-history/-/fakegato-history-0.6.4.tgz", - "integrity": "sha512-O+YFikmYutK1xqjyQOn8/ZE2ez04Sech35++CGvFMoCoycPrQTN+W2We10UNXhsorKIngSPmHPzjCQVz0ILriw==", + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/fakegato-history/-/fakegato-history-0.6.5.tgz", + "integrity": "sha512-MVam/dRAeXiMBOMY+qUN8w+6Hosx9UClUsC8dVKMzRxcHkVAN4r0ptdbf7mb78fAYbmDLcEZHHNbDBitkELPmg==", + "license": "MIT", "dependencies": { "debug": "^2.2.0", "googleapis": ">39.1.0" @@ -4290,9 +4291,10 @@ } }, "node_modules/mqtt": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.8.0.tgz", - "integrity": "sha512-/+H04mv6goy6K5gHMNH3uS0icBzXapS+4uUf4yZyQWXi72APPZNb81bQhvkm99poEQettXVT8XETB0mPxl5Wjg==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.8.1.tgz", + "integrity": "sha512-EL5yY3yOdEBOyCTM41erawRxdWmGktc48eEGO74NpEBMUbTAPepo5Id4wi+/do85sACFfsycaURvoiCNxQRTHw==", + "license": "MIT", "dependencies": { "@types/readable-stream": "^4.0.5", "@types/ws": "^8.5.9", diff --git a/package.json b/package.json index 5b08e9a5..2ce97db7 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebridge-broadlink-rm-pro", "displayName": "Homebridge Broadlink RM Pro", - "version": "4.4.17", + "version": "4.4.18", "description": "Broadlink RM plugin (including the mini and pro) for homebridge with AC Pro and TV features", "license": "ISC", "scripts": { @@ -32,10 +32,10 @@ "await-semaphore": "^0.1.3", "kiwicam-broadlinkjs-rm": "^0.9.22", "chai": "^4.3.7", - "fakegato-history": "^0.6.4", + "fakegato-history": "^0.6.5", "find-key": "^2.1.3", "github-version-checker": "^2.3.0", - "mqtt": "^5.8.0", + "mqtt": "^5.8.1", "node-persist": ">=2.1.0 <3.0.0", "semver": "^7.5.4", "node-arp": "^1.0.6",