gatewaySensorConfig.py 1.6 KB

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