devices.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. class ACATFCInstructionsRequest(BaseModel):
  31. season: str
  32. space_temperature_target: float
  33. space_realtime_temperature: Optional[float]
  34. class ACATFCInstructionsResponse(BaseModel):
  35. switch_set: int = Field(None, alias='onOff')
  36. speed_set: int = Field(None, alias='speed')
  37. temperature_set: float = Field(None, alias='temperature')
  38. mode_set: int = Field(None, alias='mode')
  39. water_valve_switch_set: int = Field(None, alias='water')
  40. class Space(BaseModel):
  41. realtime_temperature: float
  42. temperature_target: float
  43. vav_default_weight: float
  44. vav_temporary_weight: float
  45. vav_temporary_update_time: str
  46. class ACATVAInstructionsRequest(BaseModel):
  47. season: str
  48. supply_air_temperature: float
  49. supply_air_flow: float
  50. supply_air_flow_lower_limit: float
  51. supply_air_flow_upper_limit: float
  52. spaces: List[Space]
  53. class ACATVAInstructionsResponse(BaseModel):
  54. supply_air_flow_set: float = Field(None, alias='SupplyAirFlowSet')
  55. virtual_temperature_target_set: float = Field(None, alias='TargetTemperatureSet')
  56. virtual_realtime_temperature: float = Field(None, alias='VirtualRealtimeTemperature')
  57. class ACATAHFreqSetRequest(BaseModel):
  58. system_supply_static_press: float
  59. system_supply_static_press_set: float
  60. current_freq_set: float
  61. supply_air_temperature_set: float
  62. spaces_hot_rate: float
  63. class ACATAHFreqSetResponse(BaseModel):
  64. freq_set: float
  65. class SwitchSet(str, Enum):
  66. on = 'on'
  67. off = 'off'
  68. hold = 'hold'
  69. class SwitchSetRequestBase(BaseModel):
  70. running_status: bool
  71. in_cloud_status: bool
  72. on_time: str
  73. off_time: str
  74. is_workday: bool
  75. class SwitchSetResponseBase(BaseModel):
  76. switch_set: SwitchSet
  77. class ACATAHSwitchSetRequest(SwitchSetRequestBase):
  78. break_start_time: str
  79. break_end_time: str
  80. class ACATAHSwitchSetResponse(SwitchSetResponseBase):
  81. pass
  82. class ACVTSFSwitchSetRequest(SwitchSetRequestBase):
  83. pass
  84. class ACVTSFSwitchSetResponse(SwitchSetResponseBase):
  85. pass