소스 검색

推送消息内容增加内容

locky 2 년 전
부모
커밋
ed0cee4891
1개의 변경된 파일39개의 추가작업 그리고 1개의 파일을 삭제
  1. 39 1
      Service/DevicePushService.py

+ 39 - 1
Service/DevicePushService.py

@@ -371,7 +371,7 @@ class DevicePushService:
     def get_msg_text(channel, n_time, lang, tz, event_type, electricity='', is_sys=0, dealings_type=0, ai_type=0,
                      device_type=0):
         """
-        获取消息文本
+        获取推送消息内容
         """
         n_date = CommonService.get_now_time_str(n_time=n_time, tz=tz, lang=lang)
         msg_type = ''
@@ -380,6 +380,25 @@ class DevicePushService:
         if lang == 'cn':
             if event_type == 51:
                 msg_type = '检测到画面变化'
+            elif event_type == 57:
+                msg_type = '有人出现'
+            elif event_type == 58:
+                msg_type = '有车出现'
+            elif event_type == 59:
+                msg_type = '有宠物出现'
+            elif event_type == 60:
+                msg_type = '发现人脸'
+            elif event_type == 61:
+                msg_type = '有异响'
+            elif event_type == 62:
+                msg_type = '区域闯入'
+            elif event_type == 63:
+                msg_type = '区域闯出'
+            elif event_type == 64:
+                msg_type = '有人徘徊'
+            elif event_type == 65:
+                msg_type = '长时间无人出现'
+
             elif event_type == 704:
                 msg_type = '剩余电量 ' + electricity
             elif event_type == 702:
@@ -414,6 +433,25 @@ class DevicePushService:
         else:
             if event_type == 51:
                 msg_type = 'Screen change detected'
+            elif event_type == 57:
+                msg_type = 'Person detected'
+            elif event_type == 58:
+                msg_type = 'Vehicle detected'
+            elif event_type == 59:
+                msg_type = 'Pet detected'
+            elif event_type == 60:
+                msg_type = 'Human face detected'
+            elif event_type == 61:
+                msg_type = 'Abnormal sound detected'
+            elif event_type == 62:
+                msg_type = 'Intrusion detected in the area'
+            elif event_type == 63:
+                msg_type = 'Area vacated'
+            elif event_type == 64:
+                msg_type = 'Loitering detected'
+            elif event_type == 65:
+                msg_type = 'No appearance for a long time'
+
             elif event_type == 704:
                 msg_type = 'Battery remaining ' + electricity
             elif event_type == 702: