introduced config.yaml
This commit is contained in:
@@ -10,7 +10,7 @@ from flask import Flask, Response, abort, jsonify, render_template, url_for
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
||||
from .collector import Collector
|
||||
from .config import Config
|
||||
from .config import default_config, load_config
|
||||
from .netatmo import NetatmoClient
|
||||
from .rrd import ALIASES, PERIODS, RRD_ERROR, RRDStore, SCHEMAS
|
||||
|
||||
@@ -85,9 +85,9 @@ def configure_logging(app: Flask) -> None:
|
||||
threading.excepthook = uncaught_thread_exception
|
||||
|
||||
|
||||
def create_app(test_config: dict | None = None) -> Flask:
|
||||
def create_app(test_config: dict | None = None, config_path=None) -> Flask:
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(Config)
|
||||
app.config.from_mapping(load_config(config_path) if test_config is None else default_config())
|
||||
if test_config:
|
||||
app.config.update(test_config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user