Skip to content

Commit

Permalink
Fix log error (#606)
Browse files Browse the repository at this point in the history
* fix(Log): Correctly pass log to update checker

fixes #601

* chore: Fix linting errors

---------

Co-authored-by: Cameron <32912464+kiwi-cam@users.noreply.github.com>
Co-authored-by: banboobee <98196664+banboobee@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 12, 2023
1 parent bc50468 commit dee6d4b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5,389 deletions.
10 changes: 2 additions & 8 deletions CHANGELOG.md
Expand Up @@ -4,22 +4,16 @@ 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.11] - 2022-06-08
## [4.4.12] - 2022-06-08
### Added
- Added tempStepSize to configuration (defaulting to 1) to allow AC units with 0.5 steps (Thanks @nasudon) #570
- Added support for fahrenheit temperature sources #495 - set tempSourceUnits to 'F'
### Fixed
- Updated versions to address vulnerabilities
- Set HAP properties for fan speed handling (Thanks @datibbaw) #583
## Changed
- Serialised simultaneous IR/RF commands (Thanks @banboobee) #520
- Adjusted logging levels for temperature/humidity updates

## [4.4.11] - 2022-06-08
### Added
- Added support for fahrenheit temperature sources #495 - set tempSourceUnits to 'F'
### Fixed
- Updated node, homebridge, ping, semver, eslint, mocha, and release-it versions
## Changed
- Adds support for 0x520b and 0x520c Devices

## [4.4.11] - 2022-06-08
Expand Down
14 changes: 7 additions & 7 deletions accessories/aircon.js
Expand Up @@ -293,15 +293,15 @@ class AirConAccessory extends BroadlinkRMAccessory {
}
if (enableAutoOff && parseInt(onDuration) > 0) {
log(`${name} setTargetHeatingCoolingState: (automatically turn off in ${onDuration} seconds)`);
if (this.autoOffTimeoutPromise) {
if (this.autoOffTimeoutPromise) {
this.autoOffTimeoutPromise.cancel();
this.autoOffTimeoutPromise = null;
}
this.autoOffTimeoutPromise = delayForDuration(onDuration);
await this.autoOffTimeoutPromise;
await this.performSend(data.off);
this.updateServiceTargetHeatingCoolingState(this.HeatingCoolingStates.off);
this.updateServiceCurrentHeatingCoolingState(this.HeatingCoolingStates.off);
}
this.autoOffTimeoutPromise = delayForDuration(onDuration);
await this.autoOffTimeoutPromise;
await this.performSend(data.off);
this.updateServiceTargetHeatingCoolingState(this.HeatingCoolingStates.off);
this.updateServiceCurrentHeatingCoolingState(this.HeatingCoolingStates.off);
}
});
}
Expand Down
22 changes: 11 additions & 11 deletions accessories/light.js
Expand Up @@ -33,20 +33,20 @@ class LightAccessory extends SwitchAccessory {

if (exclusives) {
exclusives.forEach(exname => {
const exAccessory = accessories.find(x => x.name === exname);
//console.log(exAccessory.name);
if (exAccessory && exAccessory.config.type === 'light') {
if (!this.exclusives) this.exclusives = [];
const exAccessory = accessories.find(x => x.name === exname);
//console.log(exAccessory.name);
if (exAccessory && exAccessory.config.type === 'light') {
if (!this.exclusives) {this.exclusives = [];}
if (!this.exclusives.find(x => x === exAccessory)) {
this.exclusives.push(exAccessory);
}
if (!exAccessory.exclusives) exAccessory.exclusives = [];
if (!exAccessory.exclusives) {exAccessory.exclusives = [];}
if (!exAccessory.exclusives.find(x => x === this)) {
exAccessory.exclusives.push(this);
}
} else {
} else {
log(`${name}: No light accessory could be found with the name "${exname}". Please update the "exclusives" value or add matching light accessories.`);
}
}
});
}
}
Expand All @@ -59,15 +59,15 @@ class LightAccessory extends SwitchAccessory {

if (state.switchState) {
if (this.exclusives) {
this.exclusives.forEach(x => {
this.exclusives.forEach(x => {
if (x.state.switchState) {
log(`${name} setSwitchState: (${x.name} is configured to be turned off)`);
x.reset();
x.state.switchState = false;
x.lastBrightness = undefined;
x.serviceManager.refreshCharacteristicUI(Characteristic.On);
}
});
});
}
const brightness = (useLastKnownBrightness && state.brightness > 0) ? state.brightness : defaultBrightness;
if (brightness !== state.brightness || previousValue !== state.switchState) {
Expand Down Expand Up @@ -121,8 +121,8 @@ class LightAccessory extends SwitchAccessory {
const closest = foundValues.reduce((prev, curr) => Math.abs(curr - state.hue) < Math.abs(prev - state.hue) ? curr : prev);
var hexData = "";
// If saturation is less than 10, choose white
if (state.saturation < 10 && data[`white`]) {
hexData = data[`white`];
if (state.saturation < 10 && data.white) {
hexData = data.white;
log(`${name} setHue: (closest: white)`);
} else {
hexData = data[`hue${closest}`];
Expand Down

0 comments on commit dee6d4b

Please sign in to comment.