Moved brewfiles to source folder & add /source to sys path from __init__
This commit is contained in:
@@ -2,6 +2,8 @@ import os
|
||||
import sys
|
||||
import yaml
|
||||
from flask import Flask, request, render_template, send_file, redirect, send_from_directory
|
||||
|
||||
import source # take a look in source/__init__.py
|
||||
from brewSensor import BCM600Sensor, DHT11Sensor, BrewSensor
|
||||
from brewCamera import BrewCamera
|
||||
from brewRelay import BrewRelay
|
||||
|
||||
5
source/__init__.py
Normal file
5
source/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
print('at init')
|
||||
|
||||
import sys
|
||||
sys.path.append('/home/pi/brewLogger/source')
|
||||
print('added to source')
|
||||
@@ -183,7 +183,8 @@ class BCM600Sensor(BrewSensor):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
brewSensor = DHT11Sensor(13, 'outside', 30)
|
||||
# brewSensor = DHT11Sensor(13, 'outside', 30)
|
||||
brewSensor = BCM600Sensor('inside', 2)
|
||||
|
||||
while True:
|
||||
print(brewSensor.temp)
|
||||
@@ -12,7 +12,7 @@ def loadYaml(filePath):
|
||||
|
||||
def getConfig():
|
||||
pwd = os.path.dirname(os.path.abspath(__file__))
|
||||
path = os.path.join(pwd, 'config.yaml')
|
||||
path = os.path.join(pwd,'../', 'config.yaml')
|
||||
|
||||
if not os.path.isfile(path):
|
||||
print('Please fill out and rename config file. Check README for more info.')
|
||||
Reference in New Issue
Block a user