Browse Source

concle save sapce weight after a feedback.

highing666 3 years ago
parent
commit
4507cb6e66
2 changed files with 3 additions and 4 deletions
  1. 1 2
      app/api/routers/targets.py
  2. 2 2
      app/controllers/targets/temperature.py

+ 1 - 2
app/api/routers/targets.py

@@ -25,7 +25,6 @@ async def readjust_target(
     space_id: str = Query(..., max_length=50, regex="^Sp", alias="roomId"),
     timestamp: Optional[str] = Query(None, min_length=14, max_length=14, alias="time"),
     feedback: Optional[FeedbackValue] = Query(None, alias="itemId"),
-    db: Session = Depends(get_db),
 ):
     if not timestamp:
         timestamp = get_time_str()
@@ -33,7 +32,7 @@ async def readjust_target(
         if feedback != FeedbackValue.null:
             if project_id == "Pj1101050030":
                 need_run_room_control = await temperature_target_control_v1(
-                    project_id, space_id, feedback, db
+                    project_id, space_id, feedback
                 )
             else:
                 need_run_room_control = await temperature_target_control_v2(

+ 2 - 2
app/controllers/targets/temperature.py

@@ -556,7 +556,7 @@ class TemperatureTargetControllerV2:
 
 @logger.catch()
 async def temperature_target_control_v1(
-    project_id: str, space_id: str, feedback: FeedbackValue, db: Session
+    project_id: str, space_id: str, feedback: FeedbackValue
 ) -> bool:
     temperature_target_raw_data = await TemperatureTargetCarrier(
         project_id, space_id
@@ -569,7 +569,7 @@ async def temperature_target_control_v1(
     controlled_result = controller.get_result()
     await TargetDeliver(project_id, space_id).send(controlled_result)
 
-    WeightFlagDeliver(db, feedback).save(space_id)
+    # WeightFlagDeliver(db, feedback).save(space_id)
 
     return controlled_result["need_run_room_control"]