浏览代码

add a new logic for ACATVA

highing666 3 年之前
父节点
当前提交
cd065f1ecf
共有 2 个文件被更改,包括 25 次插入3 次删除
  1. 10 0
      app/api/routers/devices.py
  2. 15 3
      app/models/domain/devices.py

+ 10 - 0
app/api/routers/devices.py

@@ -220,3 +220,13 @@ async def get_acatva_instructions(params: domain_devices.ACATVAInstructionsReque
         )
 
     return resp
+
+
+@router.post(
+    "/instructions/acatva/v2",
+    response_model=domain_devices.ACATVAInstructionsResponseV2,
+)
+async def get_acatva_instructions_v2(
+    params: domain_devices.ACATVAInstructionsRequestV2,
+):
+    pass

+ 15 - 3
app/models/domain/devices.py

@@ -28,6 +28,7 @@ class DevicesEarlyStartTime(BaseModel):
 
 
 class ACATVIInstructionsRequest(BaseModel):
+    season: Season
     device_id: str
     return_air_temperature: float
     running_status: bool
@@ -46,7 +47,7 @@ class ACATVIInstructionsResponse(BaseModel):
     switch_set: Optional[str]
     speed_set: Optional[str]
     temperature_set: Optional[float]
-    mode_set: Optional[str]
+    # mode_set: Optional[str]
 
 
 class ACATFCInstructionsRequest(BaseModel):
@@ -83,7 +84,11 @@ class Space(BaseModel):
     vav_temporary_update_time: str
 
 
-class ACATVAInstructionsRequest(BaseModel):
+class ACATVAInstructionsRequestBase(BaseModel):
+    spaces: List[Space]
+
+
+class ACATVAInstructionsRequest(ACATVAInstructionsRequestBase):
     device_id: str
     season: str
     supply_air_temperature: Optional[float]
@@ -91,7 +96,10 @@ class ACATVAInstructionsRequest(BaseModel):
     supply_air_flow: float
     supply_air_flow_lower_limit: float
     supply_air_flow_upper_limit: float
-    spaces: List[Space]
+
+
+class ACATVAInstructionsRequestV2(ACATVAInstructionsRequestBase):
+    pass
 
 
 class ACATVAInstructionsResponse(BaseModel):
@@ -102,6 +110,10 @@ class ACATVAInstructionsResponse(BaseModel):
     )
 
 
+class ACATVAInstructionsResponseV2(BaseModel):
+    temperature_target_set: float
+
+
 class ACATAHFreqSetRequest(BaseModel):
     device_id: str
     system_supply_static_press: float