Przeglądaj źródła

fix a bug when there is not a target in a space

chenhaiyang 4 lat temu
rodzic
commit
8e37f92185
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      app/controllers/equipment/fcu/basic.py

+ 5 - 1
app/controllers/equipment/fcu/basic.py

@@ -131,7 +131,10 @@ class FCUControllerV2(EquipmentController):
             self.equipment.running_status = True
 
     def build_temperature_set(self):
-        self.equipment.setting_temperature = self.equipment.space.temperature_target
+        if np.isnan(self.equipment.space.temperature_target):
+            self.equipment.setting_temperature = 0.0
+        else:
+            self.equipment.setting_temperature = self.equipment.space.temperature_target
 
     async def run(self):
         self.build_air_valve_speed()
@@ -184,5 +187,6 @@ async def get_fcu_control_result(project_id: str, equipment_id: str) -> Dict:
         'temperature': float(round_half_up(regulated_fcu.setting_temperature, 1)),
         'water': 1 if regulated_fcu.running_status else 0
     }
+    logger.debug(output)
 
     return output