ACT Blink double

This commit is contained in:
ABelliqueux 2022-10-24 19:50:47 +02:00
parent 8f2f5711ea
commit 8bb57c476b
1 changed files with 4 additions and 0 deletions

4
app.py
View File

@ -68,15 +68,19 @@ def getRSSI():
def blinkPy(): def blinkPy():
# disable mmc access led # disable mmc access led
os.system('echo none | sudo tee /sys/class/leds/led0/trigger') os.system('echo none | sudo tee /sys/class/leds/led0/trigger')
os.system('echo none | sudo tee /sys/class/leds/led1/trigger')
# Blink 10 times # Blink 10 times
for j in range(10): for j in range(10):
# TODO : add dd to NOPASSWD in /etc/sudoers.d/010... # TODO : add dd to NOPASSWD in /etc/sudoers.d/010...
os.system('echo 1 | sudo tee /sys/class/leds/led0/brightness') # led on os.system('echo 1 | sudo tee /sys/class/leds/led0/brightness') # led on
os.system('echo 0 | sudo tee /sys/class/leds/led1/brightness') # led on
time.sleep(.2) time.sleep(.2)
os.system('echo 0 | sudo tee /sys/class/leds/led0/brightness') # led off os.system('echo 0 | sudo tee /sys/class/leds/led0/brightness') # led off
os.system('echo 1 | sudo tee /sys/class/leds/led1/brightness') # led off
time.sleep(.2) time.sleep(.2)
# restore default behavior # restore default behavior
os.system('echo mmc0 | sudo tee /sys/class/leds/led0/trigger') os.system('echo mmc0 | sudo tee /sys/class/leds/led0/trigger')
os.system('echo default-on | sudo tee /sys/class/leds/led1/trigger')
return "OK" return "OK"