diff --git a/bootstrap.py b/bootstrap.py index 6f4b4e0..69cb58f 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -15,8 +15,8 @@ from flask_restful import Api import threading import hub_api.helpers.session_helper as sh -from hub_api.session import SessionStart, SessionEnd, KeepSessionAlive -from hub_api.uptime import Uptime +from hub_api.control.session import SessionStart, SessionEnd, KeepSessionAlive +from hub_api.control.uptime import Uptime from hub_api.buildings.meb import Meb diff --git a/hub_api/config.py b/hub_api/config.py index 4e7d0b3..00bcc08 100644 --- a/hub_api/config.py +++ b/hub_api/config.py @@ -3,12 +3,10 @@ Config SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2023 Project Peter Yefi peteryefi@gmail.com """ -import pickle -from pathlib import Path -import platform import os +import platform +from pathlib import Path -from hub.city_model_structure.city import City from hub.exports.db_factory import DBFactory as CityExportFactory from hub.imports.db_factory import DBFactory @@ -29,14 +27,4 @@ class Config: self.import_db_factory = DBFactory(db_name=database_name, app_env=environment, dotenv_path=dotenv_path) - def get_city(self, city_id) -> City: - city_obj = self.export_db_factory.get_city(city_id) - city = pickle.loads(city_obj.city) - for building in city.buildings: - building.heated = True - building.cooled = True - building.attic_heated = 0 - building.basement_heated = 0 - for surface in building.surfaces: - surface.swr = 0.2 - return city + diff --git a/hub_api/session.py b/hub_api/control/session.py similarity index 100% rename from hub_api/session.py rename to hub_api/control/session.py diff --git a/hub_api/uptime.py b/hub_api/control/uptime.py similarity index 100% rename from hub_api/uptime.py rename to hub_api/control/uptime.py