From 51c725fabe7edc3f458363b9fe40e8c652cd895c Mon Sep 17 00:00:00 2001 From: James Guillochon Date: Sat, 11 May 2024 08:16:30 -0700 Subject: [PATCH 1/3] Reduce logging level of garage state retrieval Unlike other accessories, the garage door spams its get state message once a minute to the `info` level. Reducing this level to `debug` matches the behavior of other accessories. --- .../accessories/HttpWebHookGarageDoorOpenerAccessory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js b/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js index c050a64..11e2f20 100644 --- a/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js +++ b/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js @@ -118,7 +118,7 @@ HttpWebHookGarageDoorOpenerAccessory.prototype.setTargetDoorState = function(new }; HttpWebHookGarageDoorOpenerAccessory.prototype.getCurrentDoorState = function(callback) { - this.log("Getting Current Door State for '%s'...", this.id); + this.debug("Getting Current Door State for '%s'...", this.id); var state = this.storage.getItemSync("http-webhook-current-door-state-" + this.id); if (state === undefined) { state = Characteristic.CurrentDoorState.CLOSED; @@ -139,4 +139,4 @@ HttpWebHookGarageDoorOpenerAccessory.prototype.getServices = function() { return [ this.service, this.informationService ]; }; -module.exports = HttpWebHookGarageDoorOpenerAccessory; \ No newline at end of file +module.exports = HttpWebHookGarageDoorOpenerAccessory; From 54efba6ae36cba50569a16624cb68aa5a4ada462 Mon Sep 17 00:00:00 2001 From: James Guillochon Date: Sat, 11 May 2024 08:18:19 -0700 Subject: [PATCH 2/3] Reduce logging level of all state retrieve calls --- .../accessories/HttpWebHookGarageDoorOpenerAccessory.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js b/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js index 11e2f20..2fbb808 100644 --- a/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js +++ b/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js @@ -84,7 +84,7 @@ HttpWebHookGarageDoorOpenerAccessory.prototype.changeFromServer = function(urlPa } HttpWebHookGarageDoorOpenerAccessory.prototype.getTargetDoorState = function(callback) { - this.log("Getting current Target Door State for '%s'...", this.id); + this.debug("Getting current Target Door State for '%s'...", this.id); var state = this.storage.getItemSync("http-webhook-target-door-state-" + this.id); if (state === undefined) { state = Characteristic.TargetDoorState.CLOSED; @@ -127,7 +127,7 @@ HttpWebHookGarageDoorOpenerAccessory.prototype.getCurrentDoorState = function(ca }; HttpWebHookGarageDoorOpenerAccessory.prototype.getObstructionDetected = function(callback) { - this.log("Getting Obstruction Detected for '%s'...", this.id); + this.debug("Getting Obstruction Detected for '%s'...", this.id); var state = this.storage.getItemSync("http-webhook-obstruction-detected-" + this.id); if (state === undefined) { state = false; From 9b2165a3851aeff441afce3d81cc6cdf62082775 Mon Sep 17 00:00:00 2001 From: James Guillochon Date: Sat, 11 May 2024 08:21:44 -0700 Subject: [PATCH 3/3] Use right call --- .../accessories/HttpWebHookGarageDoorOpenerAccessory.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js b/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js index 2fbb808..2a099ff 100644 --- a/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js +++ b/src/homekit/accessories/HttpWebHookGarageDoorOpenerAccessory.js @@ -84,7 +84,7 @@ HttpWebHookGarageDoorOpenerAccessory.prototype.changeFromServer = function(urlPa } HttpWebHookGarageDoorOpenerAccessory.prototype.getTargetDoorState = function(callback) { - this.debug("Getting current Target Door State for '%s'...", this.id); + this.log.debug("Getting current Target Door State for '%s'...", this.id); var state = this.storage.getItemSync("http-webhook-target-door-state-" + this.id); if (state === undefined) { state = Characteristic.TargetDoorState.CLOSED; @@ -118,7 +118,7 @@ HttpWebHookGarageDoorOpenerAccessory.prototype.setTargetDoorState = function(new }; HttpWebHookGarageDoorOpenerAccessory.prototype.getCurrentDoorState = function(callback) { - this.debug("Getting Current Door State for '%s'...", this.id); + this.log.debug("Getting Current Door State for '%s'...", this.id); var state = this.storage.getItemSync("http-webhook-current-door-state-" + this.id); if (state === undefined) { state = Characteristic.CurrentDoorState.CLOSED; @@ -127,7 +127,7 @@ HttpWebHookGarageDoorOpenerAccessory.prototype.getCurrentDoorState = function(ca }; HttpWebHookGarageDoorOpenerAccessory.prototype.getObstructionDetected = function(callback) { - this.debug("Getting Obstruction Detected for '%s'...", this.id); + this.log.debug("Getting Obstruction Detected for '%s'...", this.id); var state = this.storage.getItemSync("http-webhook-obstruction-detected-" + this.id); if (state === undefined) { state = false;