Skip to content

Commit

Permalink
4.4.17 (#718)
Browse files Browse the repository at this point in the history
* Pulls new broadlinkjs-rm to remove locked device logic bug
* Reduced default logging of blind positions #702
* Reduced log level for onTemperature events (now debug events)
* Reduced log level for onHumidity events (now debug events)
* Adds support for RM3 Mini 0x27d0 (#691)
* Updated versions of mqtt, mocha, release-it, and hap-nodejs to resolve known vulnerabilities
  • Loading branch information
kiwi-cam authored Jul 17, 2024
1 parent 9ac2cd2 commit 7edb0a3
Show file tree
Hide file tree
Showing 6 changed files with 1,246 additions and 1,572 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ 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.17 - 2024-07-17]
### Added
- Adds support for RM3 Mini 0x27d0 (#691)
### Fixed
- Reduced default logging of blind positions #702
- Updated versions of mqtt, mocha, release-it, and hap-nodejs to resolve known vulnerabilities
### Changed
- Reduced log level for onTemperature events (now debug events)

## [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
4 changes: 2 additions & 2 deletions accessories/aircon.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,15 @@ class AirConAccessory extends BroadlinkRMAccessory {
temperature += temperatureAdjustment;
if (tempSourceUnits == 'F') {temperature = (temperature - 32) * 5/9;}
state.currentTemperature = temperature;
if(logLevel <=2) {log(`\x1b[36m[INFO] \x1b[0m${name} onTemperature (${temperature})`);}
if(logLevel <=1) {log(`\x1b[34m[DEBUG]\x1b[0m ${name} onTemperature (${temperature})`);}

if(humidity) {
if(noHumidity){
state.currentHumidity = null;
}else{
humidity += humidityAdjustment;
state.currentHumidity = humidity;
if(logLevel <=2) {log(`\x1b[36m[INFO] \x1b[0m${name} onHumidity (` + humidity + `)`);}
if(logLevel <=1) {log(`\x1b[34m[DEBUG]\x1b[0m ${name} onHumidity (` + humidity + `)`);}
}
}

Expand Down
2 changes: 1 addition & 1 deletion accessories/humidifier-dehumidifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class HumidifierDehumidifierAccessory extends FanAccessory {

humidity += humidityAdjustment;
state.currentHumidity = humidity;
if(logLevel <=2) {log(`\x1b[36m[INFO] \x1b[0m${name} onHumidity (` + humidity + `)`);}
if(logLevel <=1) {log(`\x1b[34m[DEBUG]\x1b[0m ${name} onHumidity (` + humidity + `)`);}

//Fakegato history update
//Ignore readings of exactly zero - the default no value value.
Expand Down
12 changes: 6 additions & 6 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 @@ -226,7 +226,7 @@ class WindowCoveringAccessory extends BroadlinkRMAccessory {

async startUpdatingCurrentPositionAtIntervals (isFirst, name, log) {
catchDelayCancelError(async () => {
const { config, serviceManager, state } = this;
const { log, logLevel, config, serviceManager, state } = this;
const { totalDurationOpen, totalDurationClose } = config;

const durationPerPercentage = this.determineOpenCloseDurationPerPercent({ positionState: state.positionState, totalDurationOpen, totalDurationClose });
Expand All @@ -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})`)};
}

// Let's go again
Expand Down
Loading

0 comments on commit 7edb0a3

Please sign in to comment.