gatewaySensorConfig.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. # 智能场景事件
  16. SCENE_EVENT_CREATE = 1
  17. SCENE_EVENT_EDIT = 2
  18. SCENE_EVENT_DELETE = 3
  19. SCENE_EVENT_EDIT_STATUS = 4
  20. SCENE_EVENT_SOS = 5
  21. # 智能场景状态
  22. SCENE_STATUS_ON = 1
  23. SCENE_STATUS_OFF = 0
  24. # 设备类型
  25. DEVICE_TYPE = {
  26. 'gateway': 200,
  27. 'socket': 201,
  28. 'switch': 202
  29. }
  30. # 传感器类型
  31. SENSOR_TYPE = {
  32. 'door_magnet': 215,
  33. 'smart_button': 216,
  34. 'water_flood_sensor': 217,
  35. 'smoke_sensor': 218,
  36. 'body_sensor': 219,
  37. 'tem_hum_sensor': 220,
  38. }
  39. # 事件类型
  40. EVENT_TYPE = {
  41. # 门磁
  42. 'door_magnet_opening': 2150,
  43. 'door_magnet_closure': 2151,
  44. 'door_magnet_removal': 2156,
  45. 'door_magnet_low_power': 2153,
  46. 'door_magnet_start_detection': 2154,
  47. 'door_magnet_closure_detection': 2155,
  48. # 智能按钮
  49. 'smart_button_press': 2160,
  50. 'smart_button_click': 2161,
  51. 'smart_button_double_click': 2162,
  52. 'smart_button_three_click': 2163,
  53. 'smart_button_low_power': 2164,
  54. # 水浸
  55. 'flood_trigger': 2170,
  56. 'flood_recovery': 2171,
  57. 'flood_low_power': 2172,
  58. # 烟雾
  59. 'smoke_trigger': 2180,
  60. 'smoke_recovery': 2181,
  61. 'smoke_removal': 2182,
  62. 'smoke_low_power': 2183,
  63. # 人体红外
  64. 'someone_moves': 2190,
  65. 'no_one_moves': 2191,
  66. 'body_sensor_removal': 2192,
  67. 'body_sensor_low_power': 2193,
  68. 'body_sensor_start_detection': 2194,
  69. 'body_sensor_closure_detection': 2195,
  70. # 温湿度
  71. 'temperature': 2200,
  72. 'humidity': 2201,
  73. 'tem_hum_sensor_low_power': 2202,
  74. # 插座电源
  75. 'socket_power_on': 2010,
  76. 'socket_power_off': 2011,
  77. }