fixed test cases
This commit is contained in:
1 parent
edc65da14b
commit
ef5e66a8f1
6 files changed
+55
-14
No files matched your search
@@ -1,5 +1,4 @@
|
||||
import os
|
||||
from typing import cast
|
||||
from decouple import config
|
||||
from pathlib import Path
|
||||
from .loader import HassConfig
|
||||
@@ -15,8 +14,9 @@ def find_hass_config() -> HassConfig:
|
||||
print("|-> ", path)
|
||||
return HassConfig(path)
|
||||
|
||||
if "HASSIO_TOKEN" in os.environ:
|
||||
return HassConfig(Path("/config"))
|
||||
config_dir = Path("/config")
|
||||
if config_dir.is_dir():
|
||||
return HassConfig(config_dir)
|
||||
|
||||
"""Put together the default configuration directory based on the OS."""
|
||||
data_dir = Path(config("APPDATA", None) if os.name == "nt" else os.path.expanduser("~"))
|
||||
|
||||
@@ -34,6 +34,7 @@ def normalize_obj(obj: Any) -> Any:
|
||||
or isinstance(obj, int)
|
||||
or isinstance(obj, float)
|
||||
or isinstance(obj, bool)
|
||||
or obj is None
|
||||
):
|
||||
return obj
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user