early_start.py 658 B

1234567891011121314
  1. from sqlalchemy.orm import Session
  2. from app.controllers.equipment.fcu.early_start import EarlyStartTimeDTRBuilder
  3. from app.crud.model_path.early_start import model_path_early_start_dtr
  4. from app.models.domain.devices import ACATVIEarlyStartPredictionRequest
  5. async def build_acatvi_early_start_prediction(params: ACATVIEarlyStartPredictionRequest, db: Session) -> float:
  6. model_path = model_path_early_start_dtr.get_path_by_device(db, params.device_id)
  7. builder = EarlyStartTimeDTRBuilder(model_path, params.season)
  8. hour = await builder.get_prediction(params.space_realtime_temperature, params.outdoor_realtime_temperature)
  9. return hour * 60