Browse Source

增加火焰检测

zhangdongming 2 years ago
parent
commit
e7938efce9
2 changed files with 8 additions and 8 deletions
  1. 4 1
      AnsjerPush/Config/aiConfig.py
  2. 4 7
      Service/DevicePushService.py

+ 4 - 1
AnsjerPush/Config/aiConfig.py

@@ -34,5 +34,8 @@ DEVICE_EVENT_TYPE = {
     512: 65,
     1024: 66,
     2048: 67,
-    4096: 68
+    4096: 68,
+    8192: 69
 }
+
+ALGORITHM_COMBO_TYPES = [51, 57, 58, 60, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69]

+ 4 - 7
Service/DevicePushService.py

@@ -16,7 +16,7 @@ import boto3
 import botocore
 import requests
 
-from AnsjerPush.Config.aiConfig import DEVICE_EVENT_TYPE
+from AnsjerPush.Config.aiConfig import DEVICE_EVENT_TYPE, ALGORITHM_COMBO_TYPES
 from AnsjerPush.config import CONFIG_INFO, CONFIG_CN, MULTI_CHANNEL_TYPE_LIST, SYS_EVENT_TYPE_LIST, AWS_ACCESS_KEY_ID, \
     AWS_SECRET_ACCESS_KEY, EVENT_DICT, EVENT_DICT_CN
 from AnsjerPush.config import XMPUSH_CONFIG, OPPOPUSH_CONFIG
@@ -238,21 +238,19 @@ class DevicePushService:
         """
         获取设备算法组合类型
         51:移动侦测,52:传感器报警,53:影像遗失,54:PIR,55:门磁报警,56:外部发报,57:人型报警(提示:有人出现),58:车型,59:宠物,60:人脸,61:异响,
-        62:区域闯入,63:区域闯出,64:长时间无人检测,65:长时间无人检测,66:往来检测,67:哭声检测,68:手势检测
+        62:区域闯入,63:区域闯出,64:长时间无人检测,65:长时间无人检测,66:往来检测,67:哭声检测,68:手势检测,69:火焰检测
         0:代表空字符,702:摄像头休眠,703:摄像头唤醒,704:电量过低
         AWS AI识别 1:人形,2:车型,3:宠物,4:包裹。云端AI类型
         """
         try:
             types = []
-            combo_types = [51, 57, 58, 60, 59, 61,
-                           62, 63, 64, 65, 66, 67, 68]
             event_type = str(event_type)
             len_type = len(event_type)
             for i in range(len_type):
                 e_type = event_type[len_type - 1 - i]
                 if e_type == '1':
-                    types.append(str(combo_types[i]))
-            LOGGING.info('算法对照打印:{}'.format(combo_types))
+                    types.append(str(ALGORITHM_COMBO_TYPES[i]))
+            LOGGING.info('算法对照打印:{}'.format(ALGORITHM_COMBO_TYPES))
             return types
         except Exception as e:
             print('推送错误异常,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
@@ -849,4 +847,3 @@ class DevicePushService:
         now_data = CommonService.get_now_time_str(now_time, tz, 'cn')
         week = LocalDateTimeUtil.date_to_week(now_data)
         return now_data, week
-