瀏覽代碼

去掉低电量推送时间限制,修改ai推送内容

locky 2 年之前
父節點
當前提交
a2b03df1ed
共有 4 個文件被更改,包括 9 次插入10 次删除
  1. 8 0
      AnsjerPush/config.py
  2. 1 1
      Controller/AiController.py
  3. 0 8
      Controller/DetectControllerV2.py
  4. 0 1
      Controller/ShadowController.py

+ 8 - 0
AnsjerPush/config.py

@@ -231,3 +231,11 @@ APP_BUNDLE_DICT = {
     'com.ansjer.customizeda_a': 'Guardian365',
     'com.ansjer.customizedc_a': 'PatrolSecure',
 }
+
+# AI识别标签
+AI_IDENTIFICATION_TAGS_DICT = {
+    '1': 'Person',
+    '2': 'Pet',
+    '3': 'Vehicle',
+    '4': 'Package'
+}

文件差異過大導致無法顯示
+ 1 - 1
Controller/AiController.py


+ 0 - 8
Controller/DetectControllerV2.py

@@ -796,14 +796,6 @@ class PWnotificationView(View):
     def validation(self, request_dict):
         logger = logging.getLogger('info')
         uid = request_dict.get('uid', None)
-
-        # 限制每24小时推一次
-        redisObj = RedisObject()
-        is_limit = redisObj.CONN.setnx(uid+'limit_power_warning', 1)
-        redisObj.CONN.expire(uid+'limit_power_warning', 2*60*60)
-        if not is_limit:
-            return JsonResponse(status=200, data={'code': 0, 'msg': 'push limited!'})
-
         channel = request_dict.get('channel', None)
         electricity = request_dict.get('electricity', None)
         logger.info('调用低电量推送接口的uid: {},electricity: {}'.format(uid, electricity))

+ 0 - 1
Controller/ShadowController.py

@@ -58,7 +58,6 @@ def generate_utk(request):
 
 
 # 设备影子更新
-@ratelimit(key='ip', rate='100/1m', block=True)
 def update_device_shadow(request):
     request.encoding = 'utf-8'
     if request.method == 'POST':

部分文件因文件數量過多而無法顯示