devices.py 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. from enum import Enum
  2. from typing import Dict, List, Optional
  3. from pydantic import BaseModel, Field
  4. from app.models.domain.feedback import FeedbackValue
  5. class ThermalMode(str, Enum):
  6. cooling = 'cooling'
  7. heating = 'heating'
  8. hold = 'hold'
  9. class DevicesInstructionsBaseResponse(BaseModel):
  10. project_id: str = Field(None, alias='projectId')
  11. device_id: str = Field(None, alias='equipId')
  12. output: Dict
  13. class DevicesEarlyStartTime(BaseModel):
  14. project_id: str = Field(None, alias='projectId')
  15. space_id: str = Field(None, alias='spaceId')
  16. minutes: float
  17. class ACATVIInstructionsRequest(BaseModel):
  18. return_air_temperature: float
  19. running_status: str
  20. current_speed: str
  21. current_temperature_set: float
  22. space_temperature_target: float
  23. space_realtime_temperature: float
  24. feedback: FeedbackValue
  25. class ACATVIInstructionsTemporaryResponse(BaseModel):
  26. output: Dict
  27. class ACATVIInstructionsResponse(BaseModel):
  28. switch_set: Optional[str]
  29. speed_set: Optional[str]
  30. temperature_set: Optional[str]
  31. mode_set: Optional[str]
  32. class ACATFCInstructionsRequest(BaseModel):
  33. season: str
  34. space_temperature_target: float
  35. space_realtime_temperature: Optional[float]
  36. class ACATFCInstructionsResponse(BaseModel):
  37. switch_set: int = Field(None, alias='onOff')
  38. speed_set: int = Field(None, alias='speed')
  39. temperature_set: float = Field(None, alias='temperature')
  40. mode_set: int = Field(None, alias='mode')
  41. water_valve_switch_set: int = Field(None, alias='water')
  42. class Space(BaseModel):
  43. realtime_temperature: float
  44. temperature_target: float
  45. vav_default_weight: float
  46. vav_temporary_weight: float
  47. vav_temporary_update_time: str
  48. class ACATVAInstructionsRequest(BaseModel):
  49. season: str
  50. supply_air_temperature: float
  51. supply_air_flow: float
  52. supply_air_flow_lower_limit: float
  53. supply_air_flow_upper_limit: float
  54. spaces: List[Space]
  55. class ACATVAInstructionsResponse(BaseModel):
  56. supply_air_flow_set: float = Field(None, alias='SupplyAirFlowSet')
  57. virtual_temperature_target_set: float = Field(None, alias='TargetTemperatureSet')
  58. virtual_realtime_temperature: float = Field(None, alias='VirtualRealtimeTemperature')
  59. class ACATAHFreqSetRequest(BaseModel):
  60. system_supply_static_press: float
  61. system_supply_static_press_set: float
  62. current_freq_set: float
  63. supply_air_temperature_set: float
  64. spaces_hot_rate: float
  65. class ACATAHFreqSetResponse(BaseModel):
  66. freq_set: float
  67. class SwitchSet(str, Enum):
  68. on = 'on'
  69. off = 'off'
  70. hold = 'hold'
  71. class SwitchSetRequestBase(BaseModel):
  72. running_status: bool
  73. in_cloud_status: bool
  74. on_time: str
  75. off_time: str
  76. is_workday: bool
  77. class SwitchSetResponseBase(BaseModel):
  78. switch_set: SwitchSet
  79. class ACATAHSwitchSetRequest(SwitchSetRequestBase):
  80. break_start_time: str
  81. break_end_time: str
  82. class ACATAHSwitchSetResponse(SwitchSetResponseBase):
  83. pass
  84. class ACVTSFSwitchSetRequest(SwitchSetRequestBase):
  85. pass
  86. class ACVTSFSwitchSetResponse(SwitchSetResponseBase):
  87. pass