From 1cc913ea9f5374d1b2a06118c54e0c8030ddc8e9 Mon Sep 17 00:00:00 2001 From: Donavan Becker <9875439+donavanbecker@users.noreply.github.com> Date: Fri, 29 May 2020 08:37:13 -0500 Subject: [PATCH] v2.1.0 #### Changes - Changed Log to only display On & Off States. - Compressed all other logging to debug. - To View This logging, turn on Homebridge Debug (-D) in Homebridge Settings of Config UI X. --- CHANGELOG.md | 11 ++++++++++- index.js | 33 +++++++++++++++++---------------- package-lock.json | 26 +++++++++++++------------- package.json | 2 +- 4 files changed, 41 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3023bf0b..324e9408 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,16 @@ All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/). -## 2.2.0 (2020-05-27) +## 2.1.0 (2020-04-13) + +## [Version 2.1.0](https://github.com/donavanbecker/homebridge-honeywell-home/compare/v2.0.0...2.1.0) + +#### Changes +- Changed Log to only display On & Off States. +- Compressed all other logging to debug. + - To View This logging, turn on Homebridge Debug (-D) in Homebridge Settings of Config UI X. + +## 2.0.0 (2020-05-27) ## [Version 2.0.0](https://github.com/donavanbecker/homebridge-honeywell-home/compare/v1.1.0...2.0.0) diff --git a/index.js b/index.js index 21540ee7..f6f46e8b 100644 --- a/index.js +++ b/index.js @@ -165,7 +165,7 @@ class Meross { let response; /* Log to the console whenever this function is called */ - this.log(`calling setOnCharacteristicHandler for ${this.config.model} at ${this.config.deviceUrl}...`); + this.log.debug(`calling setOnCharacteristicHandler for ${this.config.model} at ${this.config.deviceUrl}...`); /* * Differentiate requests based on device model. @@ -244,14 +244,15 @@ class Meross { if (response) { this.isOn = value; - this.log("Set succeeded:", response); + this.log.debug("Set succeeded:", response); + this.log(`${this.config.model} turned`, value ? "On" : "Off"); } else { this.isOn = false; this.log("Set failed:", this.isOn); } /* Log to the console the value whenever this function is called */ - this.log("setOnCharacteristicHandler:", value); + this.log.debug("setOnCharacteristicHandler:", value); /* * The callback function should be called to return the value @@ -270,7 +271,7 @@ class Meross { let response; /* Log to the console whenever this function is called */ - this.log( + this.log.debug( `calling getOnCharacteristicHandler for ${this.config.model} at ${this.config.deviceUrl}...` ); @@ -324,16 +325,16 @@ class Meross { let onOff = response.payload.all.digest.togglex[`${this.config.channel}`].onoff; - this.log("Retrieved status successfully: ", onOff); + this.log.debug("Retrieved status successfully: ", onOff); this.isOn = onOff; } else { - this.log("Retrieved status unsuccessfully."); + this.log.debug("Retrieved status unsuccessfully."); this.isOn = false; } } /* Log to the console the value whenever this function is called */ - this.log("getOnCharacteristicHandler:", this.isOn); + this.log.debug("getOnCharacteristicHandler:", this.isOn); /* * The callback function should be called to return the value @@ -349,7 +350,7 @@ class Meross { * this is called when HomeKit wants to retrieve the current state of the characteristic as defined in our getServices() function * it's called each time you open the Home app or when you open control center */ - this.log(`getDoorStateHandler for ${this.config.model} at ${this.config.deviceUrl}...`); + this.log.debug(`getDoorStateHandler for ${this.config.model} at ${this.config.deviceUrl}...`); this.getDoorState() .then(function(state) { @@ -361,7 +362,7 @@ class Meross { } async getObstructionDetectedHandler(callback) { - this.log(`getObstructionDetectedHandler for ${this.config.model} at ${this.config.deviceUrl}...`); + this.log.debug(`getObstructionDetectedHandler for ${this.config.model} at ${this.config.deviceUrl}...`); callback(null, Characteristic.ObstructionDetected.NO); } @@ -369,7 +370,7 @@ class Meross { /* this is called when HomeKit wants to update the value of the characteristic as defined in our getServices() function */ /* deviceUrl only requires ip address */ - this.log(`setDoorStateHandler ${value} for ${this.config.model} at ${this.config.deviceUrl}...`); + this.log.debug(`setDoorStateHandler ${value} for ${this.config.model} at ${this.config.deviceUrl}...`); // Stop requesting state this.stopRequestingDoorState() @@ -539,22 +540,22 @@ class Meross { switch (this.currentState) { case Characteristic.CurrentDoorState.OPEN: - this.log("Current state OPEN"); + this.log.debug("Current state OPEN"); break; case Characteristic.CurrentDoorState.CLOSED: - this.log("Current state CLOSED"); + this.log.debug("Current state CLOSED"); break; case Characteristic.CurrentDoorState.OPENING: - this.log("Current state OPENING"); + this.log.debug("Current state OPENING"); break; case Characteristic.CurrentDoorState.CLOSING: - this.log("Current state CLOSING"); + this.log.debug("Current state CLOSING"); break; case Characteristic.CurrentDoorState.STOPPED: - this.log("Current state STOPPED"); + this.log.debug("Current state STOPPED"); break; default: - this.log("Current state UNKNOWN"); + this.log.debug("Current state UNKNOWN"); } return this.currentState; diff --git a/package-lock.json b/package-lock.json index af873f0b..153a34c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "homebridge-meross", - "version": "2.0.0", + "version": "2.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -114,9 +114,9 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==" + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==" }, "balanced-match": { "version": "1.0.0", @@ -807,9 +807,9 @@ "dev": true }, "nodemon": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.3.tgz", - "integrity": "sha512-lLQLPS90Lqwc99IHe0U94rDgvjo+G9I4uEIxRG3evSLROcqQ9hwc0AxlSHKS4T1JW/IMj/7N5mthiN58NL/5kw==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.4.tgz", + "integrity": "sha512-Ltced+hIfTmaS28Zjv1BM552oQ3dbwPqI4+zI0SLgq+wpJhSyqgYude/aZa/3i31VCQWMfXJVxvu86abcam3uQ==", "dev": true, "requires": { "chokidar": "^3.2.2", @@ -908,9 +908,9 @@ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, "pstree.remy": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.7.tgz", - "integrity": "sha512-xsMgrUwRpuGskEzBFkH8NmTimbZ5PcPup0LA8JJkHIm2IMUbQcpo3yeLNWVrufEYjh8YwtSVh0xz6UeWc5Oh5A==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", + "integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==", "dev": true }, "pump": { @@ -1018,9 +1018,9 @@ } }, "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, "safer-buffer": { "version": "2.1.2", diff --git a/package.json b/package.json index 4d6b6fb4..f0e216f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-meross", - "version": "2.0.0", + "version": "2.1.0", "description": "A Meross Plugin for Homebridge", "main": "index.js", "scripts": {