Skip to content

Commit

Permalink
Reduced default logging of blind positions #702
Browse files Browse the repository at this point in the history
  • Loading branch information
kiwi-cam committed Jul 10, 2024
1 parent 397fd54 commit 5577eb3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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).

## [Unreleased]
### Fixed
- Reduced default logging of blind positions #702

## [4.4.16 - 2023-07-10]
### Fixed
- Fix for wrong command being sent or no command sent in certain circumstances #669 (Thanks @seidnerj)
Expand Down
10 changes: 5 additions & 5 deletions accessories/windowCovering.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class WindowCoveringAccessory extends BroadlinkRMAccessory {
const closeCompletely = await this.checkOpenOrCloseCompletely();
if (closeCompletely) {return;}

log(`${name} setTargetPosition: (set new position)`);
if (logLevel <= 1) {log(`${name} setTargetPosition: (set new position)`)};

// Determine if we're opening or closing
let difference = state.targetPosition - state.currentPosition;
Expand Down Expand Up @@ -126,8 +126,8 @@ class WindowCoveringAccessory extends BroadlinkRMAccessory {

const totalTime = Math.abs(difference / 100 * fullOpenCloseTime);

log(`${name} setTargetPosition: position change ${state.currentPosition}% -> ${state.targetPosition}% (${positionStateDescription})`);
log(`${name} setTargetPosition: ${+totalTime.toFixed(2)}s ((${Math.abs(difference)} / 100) * ${fullOpenCloseTime}) until auto-stop`);
if (logLevel <= 1) {log(`${name} setTargetPosition: position change ${state.currentPosition}% -> ${state.targetPosition}% (${positionStateDescription})`)};
if (logLevel <= 1) {log(`${name} setTargetPosition: ${+totalTime.toFixed(2)}s ((${Math.abs(difference)} / 100) * ${fullOpenCloseTime}) until auto-stop`)};

await this.performSend(hexData);

Expand Down Expand Up @@ -162,7 +162,7 @@ class WindowCoveringAccessory extends BroadlinkRMAccessory {
const { sendStopAt0, sendStopAt100 } = config;
const { stop } = data;

log(`${name} setTargetPosition: (stop window covering)`);
if (logLevel <= 2) {log(`${name} setTargetPosition: (stop window covering)`)};

// Reset the state and timers
this.reset();
Expand Down Expand Up @@ -250,7 +250,7 @@ class WindowCoveringAccessory extends BroadlinkRMAccessory {
const currentValue = this.getUpToDatePosition(state)
serviceManager.setCharacteristic(Characteristic.CurrentPosition, currentValue);

log(`${name} setTargetPosition: updated position to ${currentValue} (${positionStateDescription})`);
if (logLevel <= 2) {log(`${name} setTargetPosition: updated position to ${currentValue} (${positionStateDescription})`)};

Check failure on line 253 in accessories/windowCovering.js

View workflow job for this annotation

GitHub Actions / Build and Test on Node 18 and ubuntu-latest

'logLevel' is not defined

Check failure on line 253 in accessories/windowCovering.js

View workflow job for this annotation

GitHub Actions / Build and Test on Node 16 and ubuntu-latest

'logLevel' is not defined

Check failure on line 253 in accessories/windowCovering.js

View workflow job for this annotation

GitHub Actions / Build and Test on Node 20 and macOS-latest

'logLevel' is not defined

Check failure on line 253 in accessories/windowCovering.js

View workflow job for this annotation

GitHub Actions / Build and Test on Node 20 and ubuntu-latest

'logLevel' is not defined

Check failure on line 253 in accessories/windowCovering.js

View workflow job for this annotation

GitHub Actions / Build and Test on Node 18 and macOS-latest

'logLevel' is not defined

Check failure on line 253 in accessories/windowCovering.js

View workflow job for this annotation

GitHub Actions / Build and Test on Node 16 and macOS-latest

'logLevel' is not defined
}

// Let's go again
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "homebridge-broadlink-rm-pro",
"displayName": "Homebridge Broadlink RM Pro",
"version": "4.4.16",
"version": "4.4.17-beta.0",
"description": "Broadlink RM plugin (including the mini and pro) for homebridge with AC Pro and TV features",
"license": "ISC",
"scripts": {
Expand Down

0 comments on commit 5577eb3

Please sign in to comment.