Selaa lähdekoodia

roude half up to temperature target

chenhaiyang 4 vuotta sitten
vanhempi
commit
45aa6054a8
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      app/services/transfer.py

+ 2 - 1
app/services/transfer.py

@@ -11,6 +11,7 @@ from httpx import AsyncClient, URL
 from app.core.config import settings
 from app.services.service import Service
 from app.utils.date import get_time_str, TIME_FMT
+from app.utils.math import round_half_up
 
 
 class Season(str, Enum):
@@ -127,7 +128,7 @@ class SpaceInfoService(Service):
         else:
             current_lower_target, current_upper_target = np.NAN, np.NAN
 
-        return (current_lower_target + current_upper_target) / 2
+        return round_half_up((current_lower_target + current_upper_target) / 2, 2)
 
     async def env_database_set(self, form: str, value: float) -> None:
         url = self._base_url.join('duoduo-service/transfer/environment/hispoint/set')