{%
    -- 设置风扇模式为自动
    if devicetype == 'fan' and mode == 0 and math.type(timeout) ~= 'integer' then
        echo('Set fan mode successfully.\n')
        echo('Current Mode:       auto')
    -- 设置风扇模式为手动超时时间默认30s
    elseif devicetype == 'fan' and mode == 1 and math.type(timeout) ~= 'integer' then
        echo('Set fan mode successfully.\n')
        echo('Current Mode:       manual\n')
        echo('Time out    :       30 seconds')
    -- 设置风扇模式为手动带超时时间
    elseif devicetype == 'fan' and mode == 1 and TimeoutIsValid == true then
        echo('Set fan mode successfully.\n')
        echo('Current Mode:       manual\n')
        echo(string.format('Time out    :       %d seconds', timeout == 0 and 100000000 or timeout))
    -- 设置风扇模式为混合
    elseif devicetype == 'fan' and mode == 2 and math.type(timeout) ~= 'integer' then
        echo('Set fan mode successfully.\n')
        echo('Current Mode:       mixed')
    -- 设置泵模式为手动
    elseif devicetype == 'pump' and mode == 0 and math.type(timeout) ~= 'integer' and PumpSupported == true then
        echo('Set pump mode successfully.\n')
        echo('Current Mode:       auto')
    -- 设置泵模式为手动超时时间默认30s
    elseif devicetype == 'pump' and mode == 1 and math.type(timeout) ~= 'integer' and PumpSupported == true then
        echo('Set pump mode successfully.\n')
        echo('Current Mode:       manual\n')
        echo('Time out    :       30 seconds')
    -- 设置泵模式为手动带超时时间
    elseif devicetype == 'pump' and mode == 1 and TimeoutIsValid == true and PumpSupported == true then
        echo('Set pump mode successfully.\n')
        echo('Current Mode:       manual\n')
        echo(string.format('Time out    :       %d seconds', timeout == 0 and 100000000 or timeout))
    else -- 非法输入都只回显提示信息
%}
Usage: ipmcset -d coolingmode -v <devicetype> <mode> [timeout]
devicetype:
    fan{* PumpSupported == true and '\n    pump\n' or '\n' *}{# 带泵的机型提示信息包含pump参数 #}
mode:
    0    auto regulate fan speed, without parameter [timeout]
    1    manual regulate fan speed
         without parameter [timeout], default timeout(30 seconds)
         with parameter [timeout], timeout range <0-100000000>,(0 means max timeout)
{* MixedModeSupported == true and '    2    mixed regulate fan speed, without parameter [timeout]\n' or '' *}
Example:
         ipmcset -d coolingmode -v fan 0
         ipmcset -d coolingmode -v fan 1
         ipmcset -d coolingmode -v fan 1 100{* MixedModeSupported == true and '\n         ipmcset -d coolingmode -v fan 2' or '' *}{% end %}