events.py 725 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_supply_air_temperature,
  7. regulate_ahu_switch,
  8. regulate_pau_switch,
  9. regulate_ventilation_fan_switch
  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_supply_air_temperature()
  16. await regulate_ahu_freq()
  17. await regulate_ahu_switch()
  18. await regulate_pau_switch()
  19. await regulate_ventilation_fan_switch()
  20. return start_app