gatewaySensorConfig.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # -*- coding: utf-8 -*-
  2. """
  3. @Author : Rocky
  4. @Time : 2022/8/8 11:20
  5. @File :gatewaySensorConfig.py
  6. """
  7. # 智能场景定时任务
  8. SMART_SCENE_TASK = 'Controller.CeleryTasks.tasks.loocam_smart_scene'
  9. # MQTT主题名
  10. SMART_SCENE_TOPIC = 'loocam/gateway_sensor/smart_scene/{}'
  11. GET_SCENE_TOPIC = 'loocam/gateway_sensor/get_scene/{}'
  12. SUB_DEVICE_TOPIC = 'loocam/gateway_sensor/sub_device/{}'
  13. VOICE_AUDITION_TOPIC = 'loocam/gateway_sensor/voice_audition/{}'
  14. SMART_SOCKET_TOPIC = 'loocam/smart-socket/{}'
  15. ANSJER_GENERIC_TOPIC = 'ansjer/generic/{}'
  16. # 智能场景事件
  17. SCENE_EVENT_CREATE = 1
  18. SCENE_EVENT_EDIT = 2
  19. SCENE_EVENT_DELETE = 3
  20. SCENE_EVENT_EDIT_STATUS = 4
  21. SCENE_EVENT_SOS = 5
  22. # 智能场景状态
  23. SCENE_STATUS_ON = 1
  24. SCENE_STATUS_OFF = 0
  25. # 设备类型
  26. DEVICE_TYPE = {
  27. 'gateway': 200,
  28. 'socket': 201,
  29. 'switch': 202,
  30. 'C516': 24
  31. }
  32. # 传感器类型
  33. SENSOR_TYPE = {
  34. 'door_magnet': 215,
  35. 'smart_button': 216,
  36. 'water_flood_sensor': 217,
  37. 'smoke_sensor': 218,
  38. 'body_sensor': 219,
  39. 'tem_hum_sensor': 220,
  40. }
  41. # 联动设备类型列表
  42. LINKAGE_DEVICE_TYPE_LIST = [
  43. DEVICE_TYPE['socket'],
  44. DEVICE_TYPE['C516']
  45. ]
  46. # 事件类型
  47. EVENT_TYPE = {
  48. # 门磁
  49. 'door_magnet_opening': 2150,
  50. 'door_magnet_closure': 2151,
  51. 'door_magnet_removal': 2156,
  52. 'door_magnet_low_power': 2153,
  53. 'door_magnet_start_detection': 2154,
  54. 'door_magnet_closure_detection': 2155,
  55. # 智能按钮
  56. 'smart_button_press': 2160,
  57. 'smart_button_click': 2161,
  58. 'smart_button_double_click': 2162,
  59. 'smart_button_three_click': 2163,
  60. 'smart_button_low_power': 2164,
  61. # 水浸
  62. 'flood_trigger': 2170,
  63. 'flood_recovery': 2171,
  64. 'flood_low_power': 2172,
  65. # 烟雾
  66. 'smoke_trigger': 2180,
  67. 'smoke_recovery': 2181,
  68. 'smoke_removal': 2182,
  69. 'smoke_low_power': 2183,
  70. # 人体红外
  71. 'someone_moves': 2190,
  72. 'no_one_moves': 2191,
  73. 'body_sensor_removal': 2192,
  74. 'body_sensor_low_power': 2193,
  75. 'body_sensor_start_detection': 2194,
  76. 'body_sensor_closure_detection': 2195,
  77. # 温湿度
  78. 'temperature': 2200,
  79. 'humidity': 2201,
  80. 'tem_hum_sensor_low_power': 2202,
  81. # 插座电源
  82. 'socket_power_on': 2010,
  83. 'socket_power_off': 2011,
  84. # 摄像头
  85. 'detection_reminder_on': 1002,
  86. 'detection_reminder_off': 1003,
  87. 'snapshot': 1004,
  88. 'record_video': 1005,
  89. 'human_tracking_on': 1006,
  90. 'human_tracking_off': 1007,
  91. }