From 85685a49b6e45213d5d905538cd8221d6ba71e70 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sun, 3 Oct 2021 18:52:03 +0200 Subject: [PATCH] Read relay database from config --- brewRelay.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/brewRelay.py b/brewRelay.py index 3d943c9..8e89bff 100644 --- a/brewRelay.py +++ b/brewRelay.py @@ -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)