initial api work

This commit is contained in:
ari committed 2022-01-04 21:42:25 -05:00
1 parent 00505c0faa
commit fbbfee8873
15 files changed
+206 -222

No files matched your search

-20
View File
@@ -1,20 +0,0 @@
import os
from decouple import config
from pathlib import Path
def find_hass_config() -> Path:
"""Try to find HASS config."""
if "HASSIO_TOKEN" in os.environ:
return Path("/config")
"""Put together the default configuration directory based on the OS."""
data_dir = Path(config("APPDATA", None) if os.name == "nt" else os.path.expanduser("~"))
config_dir = data_dir / ".homeassistant"
if config_dir.is_dir():
return config_dir
raise ValueError(
"Unable to automatically find the location of Home Assistant " "config. Please pass it in."
)