Added an option for reloading the fanstate, this will most often be done at load of application.

This commit is contained in:
2017-06-03 18:58:07 +02:00
parent cddfbe3dfe
commit 4ca6b8b238

7
scripts/fanController.py Executable file → Normal file
View File

@@ -38,6 +38,11 @@ def turnFanOFF():
GPIO.output("CSID0", GPIO.LOW) #set CSID0 (LED) HIGH (On)
return '1'
def reloadFanstate():
if (getFanstate()):
turnFanON()
else:
turnFanOFF()
if __name__ == '__main__':
arg = argv[-1]
@@ -47,5 +52,7 @@ if __name__ == '__main__':
print(turnFanOFF())
elif (arg == 'get'):
print(getFanstate())
elif (arg == 'reload'):
reloadFanstate()
else:
print("Invalid input")