gatewaySensorConfig.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # -*- coding: utf-8 -*-
  2. """
  3. @Author : Rocky
  4. @Time : 2022/8/8 11:20
  5. @File :gatewaySensorConfig.py
  6. """
  7. # MQTT主题名
  8. SMART_SCENE_TOPIC = 'loocam/gateway_sensor/smart_scene/{}'
  9. GET_SCENE_TOPIC = 'loocam/gateway_sensor/get_scene/{}'
  10. SUB_DEVICE_TOPIC = 'loocam/gateway_sensor/sub_device/{}'
  11. VOICE_AUDITION_TOPIC = 'loocam/gateway_sensor/voice_audition/{}'
  12. # 智能场景事件
  13. SCENE_EVENT_CREATE = 1
  14. SCENE_EVENT_EDIT = 2
  15. SCENE_EVENT_DELETE = 3
  16. SCENE_EVENT_EDIT_STATUS = 4
  17. # 智能场景状态
  18. SCENE_STATUS_ON = 1
  19. SCENE_STATUS_OFF = 0
  20. # 传感器类型
  21. SENSOR_TYPE = {
  22. 'door_magnet': 215,
  23. 'smart_button': 216,
  24. 'water_flood_sensor': 217,
  25. 'smoke_sensor': 218,
  26. 'body_sensor': 219,
  27. 'tem_hum_sensor': 220,
  28. }
  29. # 事件类型
  30. EVENT_TYPE = {
  31. # 门磁
  32. 'door_magnet_opening': 2150,
  33. 'door_magnet_closure': 2151,
  34. 'door_magnet_removal': 2152,
  35. 'door_magnet_low_power': 2153,
  36. 'door_magnet_start_detection': 2154,
  37. 'door_magnet_closure_detection': 2155,
  38. # 智能按钮
  39. 'smart_button_press': 2160,
  40. 'smart_button_click': 2161,
  41. 'smart_button_double_click': 2162,
  42. 'smart_button_three_click': 2163,
  43. 'smart_button_low_power': 2164,
  44. # 水浸
  45. 'flood_trigger': 2170,
  46. 'flood_recovery': 2171,
  47. 'flood_low_power': 2172,
  48. # 烟雾
  49. 'smoke_trigger': 2180,
  50. 'smoke_recovery': 2181,
  51. 'smoke_removal': 2182,
  52. 'smoke_low_power': 2183,
  53. # 人体红外
  54. 'someone_moves': 2190,
  55. 'no_one_moves': 2191,
  56. 'body_sensor_removal': 2192,
  57. 'body_sensor_low_power': 2193,
  58. 'body_sensor_start_detection': 2194,
  59. 'body_sensor_closure_detection': 2195,
  60. # 温湿度
  61. 'temperature': 2200,
  62. 'humidity': 2201,
  63. 'tem_hum_sensor_low_power': 2202,
  64. }