jmarucha / FanControl.Liquidctl

Get access to the pump and temperature sensors of your AIO in FanControl
GNU General Public License v3.0
40 stars 17 forks source link

NZXT Kraken X72 - Lack of Pump Duty causes unhandled exception and no UI in Fan Control #1

Open reelmccoy opened 2 years ago

reelmccoy commented 2 years ago

With a system with a NZXT Kraken X72, there is no pump duty in the status return. Just pump speed, fan speed and liquid temperature. This appears to cause an unhandled exception in FanControl.Liquidctl and exceptions in FanControl trying to construct UI elements.

In LiquidctlDevice.cs, the constructor that takes the JSON output, hasPumpDuty and hasPumpSpeed are being set based off of the other strings' key value.

        hasPumpSpeed = output.status.Exists(entry => entry.key == "Pump duty" && !(entry.value is null));
        if (hasPumpSpeed)
            pumpDuty = new PumpDuty(output);

        hasPumpDuty = output.status.Exists(entry => entry.key == "Pump speed" && !(entry.value is null));
        if (hasPumpDuty)
            pumpSpeed = new PumpSpeed(output);

should be:

        hasPumpDuty = output.status.Exists(entry => entry.key == "Pump duty" && !(entry.value is null));
        if (hasPumpDuty)
            pumpDuty = new PumpDuty(output);

        hasPumpSpeed = output.status.Exists(entry => entry.key == "Pump speed" && !(entry.value is null));
        if (hasPumpSpeed)
            pumpSpeed = new PumpSpeed(output);

With this change, FanControl loads successfully with the UI available and the X72's pump speed and temperature sensor data is available.

jmarucha commented 2 years ago

Good spot!

momala454 commented 1 year ago

@jmarucha can you fix please