Skip to content

Commit

Permalink
v2.1.0
Browse files Browse the repository at this point in the history
#### 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.
  • Loading branch information
donavanbecker authored May 29, 2020
1 parent e05bb73 commit 1cc913e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 31 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
33 changes: 17 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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}...`
);

Expand Down Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -361,15 +362,15 @@ 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);
}

async setDoorStateHandler(value, callback) {
/* 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()
Expand Down Expand Up @@ -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;
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 1cc913e

Please sign in to comment.