# -*- coding: utf-8 -*- from enum import Enum import numpy as np from pydantic import BaseModel from app.schemas.space import Space class AirValveSpeed(float, Enum): off = 0.0 low = 1.0 medium = 2.0 high = 3.0 class VRFMode(str, Enum): cooling = "cooling" heating = "heating" ventilation = "ventilation" unknown = "unknown" class BaseEquipment(BaseModel): id: str | None running_status: bool | None in_cloud_status: bool | None on_time: str | None off_time: str | None equip_switch_set: bool | None acc_run_time: float | None class FCU(BaseEquipment): work_mode: int | None air_valve_speed: AirValveSpeed | None = AirValveSpeed.off air_valve_speed_set: AirValveSpeed | None = AirValveSpeed.off recommended_speed: AirValveSpeed | None = AirValveSpeed.off space: Space | None setting_temperature: float | None supply_air_temperature: float | None water_out_temperature: float | None water_in_temperature: float | None speed_limit: AirValveSpeed | None = AirValveSpeed.high class VAVBox(BaseEquipment): spaces: list[Space] | None supply_air_temperature: float | None = np.NAN supply_air_flow: float | None = np.NAN supply_air_flow_set: float | None = np.NAN supply_air_flow_lower_limit: float | None = np.NAN supply_air_flow_upper_limit: float | None = np.NAN recommended_supply_air_flow: float | None = np.NAN valve_opening: float | None = np.NAN setting_temperature: float | None = 0.0 virtual_realtime_temperature: float | None = np.NAN virtual_target_temperature: float | None = np.NAN class AHU(BaseEquipment): supply_air_temperature: float | None supply_air_temperature_set: float | None return_air_temperature: float | None return_air_temperature_set: float | None freq: float | None freq_set: float | None fan_freq_upper_limit_set: float | None fan_freq_lower_limit_set: float | None class VentilationFan(BaseEquipment): pass class PAU(BaseEquipment): pass class VRF(BaseEquipment): equip_switch_set: str | None work_mode: VRFMode | None speed: str | None speed_set: str | None current_temperature_set: float | None temperature_set: float | None mode_set: str | None return_air_temp: float | None class ASHP(BaseEquipment): out_temp_15min: list[float] out_temp_set_15min: list[float] out_temp_30min: list[float] out_temp_set_30min: list[float] out_temp_set: float | None out_temp: float | None in_temp: float | None iplr_15min: list[float] iplr_30min: list[float] class FeedWaterPump(BaseEquipment): work_freq: float | None work_freq_set: float | None