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