|
@@ -9,6 +9,7 @@ from loguru import logger
|
|
from app.controllers.equipment.controller import EquipmentController
|
|
from app.controllers.equipment.controller import EquipmentController
|
|
from app.models.domain.devices import ACATFCInstructionsRequest
|
|
from app.models.domain.devices import ACATFCInstructionsRequest
|
|
from app.schemas.equipment import AirValveSpeed, FCU
|
|
from app.schemas.equipment import AirValveSpeed, FCU
|
|
|
|
+from app.schemas.instructions import ACATFCInstructions
|
|
from app.schemas.space import Space
|
|
from app.schemas.space import Space
|
|
from app.services.platform import DataPlatformService, InfoCode
|
|
from app.services.platform import DataPlatformService, InfoCode
|
|
from app.services.transfer import SpaceInfoService, Duoduo, Season
|
|
from app.services.transfer import SpaceInfoService, Duoduo, Season
|
|
@@ -220,7 +221,7 @@ async def get_fcu_control_result(project_id: str, equipment_id: str) -> Dict:
|
|
|
|
|
|
|
|
|
|
@logger.catch()
|
|
@logger.catch()
|
|
-async def build_acatfc_instructions(params: ACATFCInstructionsRequest) -> Dict:
|
|
|
|
|
|
+async def build_acatfc_instructions(params: ACATFCInstructionsRequest) -> ACATFCInstructions:
|
|
space = Space(
|
|
space = Space(
|
|
temperature_target=params.space_temperature_target,
|
|
temperature_target=params.space_temperature_target,
|
|
realtime_temperature=params.space_realtime_temperature
|
|
realtime_temperature=params.space_realtime_temperature
|
|
@@ -235,12 +236,12 @@ async def build_acatfc_instructions(params: ACATFCInstructionsRequest) -> Dict:
|
|
await controller.run()
|
|
await controller.run()
|
|
regulated_fcu = controller.get_results()
|
|
regulated_fcu = controller.get_results()
|
|
|
|
|
|
- instructions = {
|
|
|
|
- 'switch_set': 1 if regulated_fcu.running_status else 0,
|
|
|
|
- 'speed_set': regulated_fcu.air_valve_speed.value,
|
|
|
|
- 'temperature_set': float(round_half_up(regulated_fcu.setting_temperature, 1)),
|
|
|
|
- 'mode_set': regulated_fcu.work_mode,
|
|
|
|
- 'water_valve_switch_set': 1 if regulated_fcu.running_status else 0
|
|
|
|
- }
|
|
|
|
|
|
+ instructions = ACATFCInstructions(
|
|
|
|
+ switch_set=1 if regulated_fcu.running_status else 0,
|
|
|
|
+ speed_set=regulated_fcu.air_valve_speed.value,
|
|
|
|
+ temperature_set=float(round_half_up(regulated_fcu.setting_temperature, 1)),
|
|
|
|
+ mode_set=regulated_fcu.work_mode,
|
|
|
|
+ water_valve_switch_set=1 if regulated_fcu.running_status else 0
|
|
|
|
+ )
|
|
|
|
|
|
return instructions
|
|
return instructions
|