supply_air_temperature_set.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. from typing import List
  2. import arrow
  3. from httpx import AsyncClient
  4. from loguru import logger
  5. class ACATFUSupplyAirTemperatureController:
  6. """
  7. Supply air temperature setting logic version 1 by Wenyan.
  8. """
  9. def __init__(self, current_supply_air_temp: float, cold_space_count: float, hot_space_count: float):
  10. self.current_air_temp = current_supply_air_temp
  11. self.cold_space_count = cold_space_count
  12. self.hot_space_count = hot_space_count
  13. def get_next_set(self, is_just_booted: bool, cold_hot_ratio: float) -> float:
  14. if is_just_booted:
  15. if cold_hot_ratio < 0.5:
  16. next_temperature_set = 8.0
  17. elif cold_hot_ratio < 0.9:
  18. next_temperature_set = 11.0
  19. elif cold_hot_ratio < 1.1:
  20. next_temperature_set = 14.0
  21. elif cold_hot_ratio < 1.5:
  22. next_temperature_set = 17.0
  23. else:
  24. next_temperature_set = 20.0
  25. else:
  26. if cold_hot_ratio < 0.5:
  27. diff = -3
  28. elif cold_hot_ratio < 0.9:
  29. diff = -2
  30. elif cold_hot_ratio < 1.1:
  31. diff = 0
  32. elif cold_hot_ratio < 1.5:
  33. diff = 2
  34. else:
  35. diff = 3
  36. next_temperature_set = self.current_air_temp + diff
  37. return next_temperature_set