cleaned up api
This commit is contained in:
1 parent
f8e615304c
commit
25e65540e1
5 files changed
+7
-8
No files matched your search
@@ -1,5 +0,0 @@
|
||||
from src.automations.manager import AutomationManager
|
||||
from src.hass_config import find_hass_config
|
||||
|
||||
hass_config = find_hass_config()
|
||||
automations = AutomationManager(hass_config)
|
||||
@@ -1,6 +1,6 @@
|
||||
from src.automations.manager import AutomationManager
|
||||
from src.hass_config import find_hass_config
|
||||
from .app import make_app
|
||||
from src.api.app import make_app
|
||||
|
||||
hass_config = find_hass_config()
|
||||
app = make_app(AutomationManager(hass_config))
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
from typing import cast
|
||||
from decouple import config
|
||||
from pathlib import Path
|
||||
from .loader import HassConfig
|
||||
@@ -6,6 +7,10 @@ from .loader import HassConfig
|
||||
|
||||
def find_hass_config() -> HassConfig:
|
||||
"""Try to find HASS config."""
|
||||
if config("USE_EXAMPLE_REPO", False, cast=bool):
|
||||
from tests.utils import create_copy_of_example_config
|
||||
return HassConfig(create_copy_of_example_config())
|
||||
|
||||
if "HASSIO_TOKEN" in os.environ:
|
||||
return HassConfig(Path("/config"))
|
||||
|
||||
|
||||
Reference in new issue
Block a user