small refactor to organize the source code

This commit is contained in:
Guille Gutierrez 2023-03-10 10:18:27 -05:00
parent fa06b571f8
commit c68b1a38ca
4 changed files with 5 additions and 17 deletions

View File

@ -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

View File

@ -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