mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
56 lines
1.6 KiB
Python
56 lines
1.6 KiB
Python
from functools import lru_cache
|
|
from pydantic import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_KEY: str
|
|
API_KEY_NAME: str = "X-API-KEY"
|
|
SECRET_KEY: str
|
|
ENVIRONMENT: str
|
|
DATA_BUCKET: str
|
|
PLAN_TRIGGER_BUCKET: str
|
|
|
|
# Third parties
|
|
EPC_AUTH_TOKEN: str
|
|
ORDNANCE_SURVEY_API_KEY: str
|
|
GOOGLE_SOLAR_API_KEY: str
|
|
FARADAY_API_KEY: str
|
|
|
|
# Database settings
|
|
DB_HOST: str
|
|
DB_PASSWORD: str
|
|
DB_USERNAME: str
|
|
DB_PORT: str
|
|
DB_NAME: str
|
|
|
|
# Prediction buckets
|
|
SAP_PREDICTIONS_BUCKET: str
|
|
CARBON_PREDICTIONS_BUCKET: str
|
|
HEAT_PREDICTIONS_BUCKET: str
|
|
LIGHTING_COST_PREDICTIONS_BUCKET: str
|
|
HEATING_COST_PREDICTIONS_BUCKET: str
|
|
HOT_WATER_COST_PREDICTIONS_BUCKET: str
|
|
HEATING_KWH_PREDICTIONS_BUCKET: str
|
|
HOTWATER_KWH_PREDICTIONS_BUCKET: str
|
|
|
|
class Config:
|
|
env_file = "backend/.env"
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings():
|
|
return Settings()
|
|
|
|
|
|
@lru_cache()
|
|
def get_prediction_buckets():
|
|
return {
|
|
"sap_change_predictions": get_settings().SAP_PREDICTIONS_BUCKET,
|
|
"heat_demand_predictions": get_settings().HEAT_PREDICTIONS_BUCKET,
|
|
"carbon_change_predictions": get_settings().CARBON_PREDICTIONS_BUCKET,
|
|
"lighting_cost_predictions": get_settings().LIGHTING_COST_PREDICTIONS_BUCKET,
|
|
"heating_cost_predictions": get_settings().HEATING_COST_PREDICTIONS_BUCKET,
|
|
"hot_water_cost_predictions": get_settings().HOT_WATER_COST_PREDICTIONS_BUCKET,
|
|
"heating_kwh_predictions": get_settings().HEATING_KWH_PREDICTIONS_BUCKET,
|
|
"hotwater_kwh_predictions": get_settings().HOTWATER_KWH_PREDICTIONS_BUCKET,
|
|
}
|