def METHOD_NAME(self, idx):
    # 1 based fan index
    if idx < 1 or idx > self.num_fans:
        print("Invalid fan index %d\n" % idx)
        return 0
    attr = "fan" + str(idx) + "_input"
    output = pddf_obj.get_attr_name_output("FAN-CTRL", attr)
    if not output:
        return 0
    #mode = output['mode']
    val = output['status'].rstrip()
    if val.isalpha():
        return 0
    else:
        rpm_speed = int(float(val))
    return rpm_speed