mirror of
https://github.com/KevinMidboe/fanController.git
synced 2025-10-29 17:40:22 +00:00
Added an option for reloading the fanstate, this will most often be done at load of application.
This commit is contained in:
7
scripts/fanController.py
Executable file → Normal file
7
scripts/fanController.py
Executable file → Normal 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")
|
||||
|
||||
Reference in New Issue
Block a user