public function setFanMode($mode, $serial_number = NULL) {
        $duty_cycle = NULL;
        $timer = NULL;
        if (is_array($mode)) {
            $modes = $mode;
            $mode = $modes[0];
            if (count($modes) > 1) {
                if ($mode == FAN_MODE_MINUTES_PER_HOUR) {
                    $duty_cycle = (int) $modes[1];
                } else {
                    $timer = (int) $modes[1];
                }
            } else {
                throw new Exception("setFanMode(array \$mode[, ...]) needs at least a mode and a value in the \$mode array.");
            }
        } elseif (!is_string($mode)) {
            throw new Exception("setFanMode() can only take a string or an array as it's first parameter.");
        }
        return $this->_setFanMode($mode, $duty_cycle, $timer, $serial_number);
    }