Added dotenv support to fanctl
This commit is contained in:
parent
088f248944
commit
a48fa91e6f
10
fanctl.py
10
fanctl.py
|
@ -1,10 +1,18 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
servo = 18
|
||||||
|
|
||||||
|
if true: # set to false to skip using dotenv
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
load_dotenv()
|
||||||
|
servo = int(os.getenv('FANCTL_SERVO_PIN'))
|
||||||
|
|
||||||
import RPi.GPIO as IO
|
import RPi.GPIO as IO
|
||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
servo = 18
|
|
||||||
|
|
||||||
IO.setwarnings(False)
|
IO.setwarnings(False)
|
||||||
IO.setmode (IO.BCM)
|
IO.setmode (IO.BCM)
|
||||||
|
|
Loading…
Reference in New Issue