|
@@ -10,7 +10,6 @@ from app.schemas.equipment import AHU
|
|
|
from app.schemas.system import ACAT
|
|
|
from app.services.platform import DataPlatformService, InfoCode
|
|
|
from app.services.transfer import Duoduo
|
|
|
-from app.services.weather import WeatherService
|
|
|
|
|
|
|
|
|
class AHUController:
|
|
@@ -49,24 +48,6 @@ class AHUController:
|
|
|
|
|
|
return freq_set
|
|
|
|
|
|
- @staticmethod
|
|
|
- async def build_supply_air_temperature_set(outdoor_temperature: float) -> float:
|
|
|
- if outdoor_temperature <= 19.0:
|
|
|
- supply_air_temperature_set = 22.0
|
|
|
- elif outdoor_temperature <= 24.0:
|
|
|
- supply_air_temperature_set = 21.0
|
|
|
- elif outdoor_temperature <= 29.0:
|
|
|
- supply_air_temperature_set = 20.0
|
|
|
- elif outdoor_temperature <= 33.0:
|
|
|
- supply_air_temperature_set = 19.0
|
|
|
- else:
|
|
|
- supply_air_temperature_set = 18.0
|
|
|
-
|
|
|
- return supply_air_temperature_set
|
|
|
-
|
|
|
- def get_result(self) -> AHU:
|
|
|
- return self._equipment
|
|
|
-
|
|
|
|
|
|
@logger.catch()
|
|
|
async def get_freq_controlled(project_id: str, equipment_id: str) -> None:
|
|
@@ -106,19 +87,3 @@ async def get_freq_controlled(project_id: str, equipment_id: str) -> None:
|
|
|
async with AsyncClient() as client:
|
|
|
platform = DataPlatformService(client, project_id)
|
|
|
await platform.set_code_value(equipment_id, InfoCode.fan_freq_set, new_freq_set)
|
|
|
-
|
|
|
-
|
|
|
-@logger.catch()
|
|
|
-async def get_supply_air_temperature_controlled(project_id: str, equipment_id: str) -> None:
|
|
|
- async with AsyncClient() as client:
|
|
|
- weather_service = WeatherService(client)
|
|
|
- realtime_weather = await weather_service.get_realtime_weather(project_id)
|
|
|
- outdoor_temperature = float(realtime_weather.get('temperature'))
|
|
|
-
|
|
|
- ahu_controller = AHUController()
|
|
|
- new_supply_air_temperature_set = await ahu_controller.build_supply_air_temperature_set(outdoor_temperature)
|
|
|
- # logger.debug(f'{equipment_id} supply air temperature set: {new_supply_air_temperature_set}')
|
|
|
-
|
|
|
- async with AsyncClient() as client:
|
|
|
- platform = DataPlatformService(client, project_id)
|
|
|
- await platform.set_code_value(equipment_id, InfoCode.supply_air_temperature_set, new_supply_air_temperature_set)
|