events.py 650 B

123456789101112131415161718192021222324
  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_ventilation_fan_switch,
  8. )
  9. # from app.controllers.events import load_q_learning_model
  10. def create_start_app_handler(app: Optional[FastAPI] = None) -> Callable:
  11. async def start_app() -> None:
  12. # await load_q_learning_model()
  13. await regulate_ahu_freq()
  14. await regulate_ahu_switch()
  15. # await regulate_pau_switch()
  16. await regulate_ventilation_fan_switch()
  17. # await run_control_group()
  18. return start_app