events.py 825 B

123456789101112131415161718192021222324252627282930
  1. # -*- coding: utf-8 -*-
  2. from fastapi_utils.tasks import repeat_every
  3. from app.controllers.equipment.ahu.basic import get_freq_controlled, get_supply_air_temperature_controlled
  4. @repeat_every(seconds=5)
  5. async def regulate_ahu_freq():
  6. _PROJECT_ID = 'Pj1101050030'
  7. _AHU_LIST = [
  8. 'Eq1101050030b6b2f1db3d6944afa71e213e0d45d565',
  9. 'Eq1101050030846e0a94670842109f7c8d8db0d44cf5'
  10. ]
  11. for ahu in _AHU_LIST:
  12. await get_freq_controlled(_PROJECT_ID, ahu)
  13. @repeat_every(seconds=5)
  14. async def regulate_ahu_supply_air_temperature():
  15. _PROJECT_ID = 'Pj1101050030'
  16. _AHU_LIST = [
  17. 'Eq1101050030b6b2f1db3d6944afa71e213e0d45d565',
  18. 'Eq1101050030846e0a94670842109f7c8d8db0d44cf5'
  19. ]
  20. for ahu in _AHU_LIST:
  21. await get_supply_air_temperature_controlled(_PROJECT_ID, ahu)