from typing import List import arrow from httpx import AsyncClient from loguru import logger class ACATFUSupplyAirTemperatureController: """ Supply air temperature setting logic version 1 by Wenyan. """ def __init__(self, current_supply_air_temp: float, cold_space_count: float, hot_space_count: float): self.current_air_temp = current_supply_air_temp self.cold_space_count = cold_space_count self.hot_space_count = hot_space_count def get_next_set(self, is_just_booted: bool, cold_hot_ratio: float) -> float: if is_just_booted: if cold_hot_ratio < 0.5: next_temperature_set = 8.0 elif cold_hot_ratio < 0.9: next_temperature_set = 11.0 elif cold_hot_ratio < 1.1: next_temperature_set = 14.0 elif cold_hot_ratio < 1.5: next_temperature_set = 17.0 else: next_temperature_set = 20.0 else: if cold_hot_ratio < 0.5: diff = -3 elif cold_hot_ratio < 0.9: diff = -2 elif cold_hot_ratio < 1.1: diff = 0 elif cold_hot_ratio < 1.5: diff = 2 else: diff = 3 next_temperature_set = self.current_air_temp + diff return next_temperature_set