gatewaySensorConfig.py 1.7 KB

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