Wait when retrieving fan speeds after a speed change, so the new speed is shown

master
root 5 years ago
parent a87a3d2ddf
commit d25b50a10a

@ -1,7 +1,7 @@
#!/usr/bin/python3 #!/usr/bin/python3
import run_cmd import run_cmd
import argparse import argparse
import time
MAXFAN = 6 MAXFAN = 6
parser = argparse.ArgumentParser(description='Read information about and control fans on ASRock boards with IPMI.', prog='asrock-pwm-ipmi') parser = argparse.ArgumentParser(description='Read information about and control fans on ASRock boards with IPMI.', prog='asrock-pwm-ipmi')
@ -17,6 +17,7 @@ args = parser.parse_args()
#print(args.info) #print(args.info)
#print(args) #print(args)
#print(args.fanplusspeed) #print(args.fanplusspeed)
fanChanged = False
if args.info is False and args.fanplusspeed == []: if args.info is False and args.fanplusspeed == []:
print("Nothing to do! See --help for usage.") print("Nothing to do! See --help for usage.")
quit quit
@ -27,11 +28,15 @@ if args.fanplusspeed != []:
continue continue
fan, speed = fanopt.split(":") fan, speed = fanopt.split(":")
run_cmd.setSpeed(int(fan), int(speed)) run_cmd.setSpeed(int(fan), int(speed))
fanChanged = True
if int(speed) == 0: if int(speed) == 0:
print("Set speed of FAN" + fan + " to Auto.") print("Set speed of FAN" + fan + " to Auto.")
else: else:
print("Set speed of FAN" + fan + " to " + speed + "%.") print("Set speed of FAN" + fan + " to " + speed + "%.")
if args.info is True: if args.info is True:
if fanChanged is True:
print("\nWaiting for fans to adjust...")
time.sleep(5)
print("\nRetrieving fan speeds...\n") print("\nRetrieving fan speeds...\n")
for line in run_cmd.getFanInfo(): for line in run_cmd.getFanInfo():
print(line) print(line)

Loading…
Cancel
Save