gatewaySensorConfig.py 1.6 KB

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