Read relay database from config

This commit is contained in:
2021-10-03 18:52:03 +02:00
parent b75671e68c
commit 85685a49b6

View File

@@ -1,5 +1,6 @@
import RPi.GPIO as GPIO
from logger import logger
from utils import getConfig
import sqlite3
class BrewRelay():
@@ -8,7 +9,8 @@ class BrewRelay():
self.pin = pin
self.controls = controls
self.conn = sqlite3.connect('brew.db', check_same_thread=False)
config = getConfig()
self.conn = sqlite3.connect(config['database']['name'], check_same_thread=False)
self.cur = self.conn.cursor()
GPIO.setup(self.pin, GPIO.OUT)