Added dotenv support to fanctl

This commit is contained in:
Thord Johansson 2023-04-30 14:11:52 +02:00
parent 088f248944
commit a48fa91e6f

View File

@ -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)