From fc3792d62f9285c8859d4bc5a1107d81ba893ea4 Mon Sep 17 00:00:00 2001 From: Jordy van den Aardweg Date: Fri, 30 Dec 2022 13:40:30 +0100 Subject: [PATCH] fix: vremote speed controls not working due to config changes --- src/fan-accessory.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/fan-accessory.ts b/src/fan-accessory.ts index 3876820..16af55b 100644 --- a/src/fan-accessory.ts +++ b/src/fan-accessory.ts @@ -210,7 +210,7 @@ export class FanAccessory { // If the device is a non-CVE device, we cannot control the fan speed manually. We also have to use virtual remote commands for this. // https://github.com/arjenhiemstra/ithowifi/wiki/Non-CVE-units-support#how-to-control-the-speed - return !this.config.device?.co2Sensor || !this.config.device?.nonCve; + return !this.config.device?.co2Sensor && !this.config.device?.nonCve; } // get targetFanState(): Nullable { @@ -396,9 +396,17 @@ export class FanAccessory { sendVirtualRemoteCommand(speedValue: number): void { const virtualRemoteCommand = getVirtualRemoteCommandForRotationSpeed(speedValue); - this.log.warn( - `Your unit has a build in CO2 sensor, which prohibits the use of manual speed control. We'll map the speed "${speedValue}" to a virtual remote command "${virtualRemoteCommand}" instead.`, - ); + if (this.config.device?.co2Sensor) { + this.log.warn( + `Your unit has a build in CO2 sensor, which prohibits the use of manual speed control. We'll map the speed "${speedValue}" to a virtual remote command "${virtualRemoteCommand}" instead.`, + ); + } + + if (this.config.device?.nonCve) { + this.log.warn( + `Your unit is not a CVE unit, which prohibits the use of manual speed control. We'll map the speed "${speedValue}" to a virtual remote command "${virtualRemoteCommand}" instead.`, + ); + } if (this.mqttApiClient) { this.mqttApiClient.setVirtualRemoteCommand(virtualRemoteCommand);