fixed shell file path
This commit is contained in:
3
lightSwitch.py
Normal file → Executable file
3
lightSwitch.py
Normal file → Executable file
@@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import RPi.GPIO as GPIO
|
import RPi.GPIO as GPIO
|
||||||
@@ -23,7 +24,7 @@ try:
|
|||||||
while True:
|
while True:
|
||||||
if touchDet(touchPin):
|
if touchDet(touchPin):
|
||||||
print('['+time.ctime()+'] - '+'Touch Detected, Light Switch Toggled')
|
print('['+time.ctime()+'] - '+'Touch Detected, Light Switch Toggled')
|
||||||
subprocess.run('./lightSwitch.sh')
|
subprocess.run('./home/pi/homeassistantPi/lightSwitch.sh')
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
Reference in New Issue
Block a user