gatewaySensorConfig.py 1.9 KB

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