Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log error #606

Merged
merged 18 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 2 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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