devices.py 3.2 KB

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