public async Task <byte> GetFanMode(CoolitSensorAddress fanAddress)
        {
            await DoSetCurrentFan(fanAddress);

            await cmd.Run((byte)CoolitModernCommandCode.FAN_MODE_GET);

            if (cmd.IsFaulted)
            {
                return(0);
            }

            byte mode = ByteParser.ParseResponse(cmd.Result);

            return((byte)(mode & 0x8E)); // high bit is set if fan detected, bits 3..1 contain fan mode. Low bit is set when the fan is 4-pin, ignore it.
        }
Exemple #2
0
 private async Task RunCmdSynchronized(CommandStateMachine cmd, byte data)
 {
     await cmd.Run(data);
 }