events.py 693 B

1234567891011121314151617181920212223242526
  1. # -*- coding: utf-8 -*-
  2. from typing import Callable, Optional
  3. from fastapi import FastAPI
  4. from app.controllers.equipment.events import (
  5. regulate_ahu_freq,
  6. regulate_ahu_switch,
  7. regulate_pau_switch,
  8. regulate_ventilation_fan_switch,
  9. run_control_group
  10. )
  11. from app.controllers.events import load_q_learning_model
  12. def create_start_app_handler(app: Optional[FastAPI] = None) -> Callable:
  13. async def start_app() -> None:
  14. await load_q_learning_model()
  15. await regulate_ahu_freq()
  16. await regulate_ahu_switch()
  17. # await regulate_pau_switch()
  18. await regulate_ventilation_fan_switch()
  19. # await run_control_group()
  20. return start_app