devices.py 3.0 KB

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