Pārlūkot izejas kodu

推送消息内容增加51类型

locky 2 gadi atpakaļ
vecāks
revīzija
5ce406d7f4
1 mainītis faili ar 8 papildinājumiem un 4 dzēšanām
  1. 8 4
      Service/DevicePushService.py

+ 8 - 4
Service/DevicePushService.py

@@ -377,7 +377,9 @@ class DevicePushService:
         event_type = int(event_type)
         device_type = int(device_type)
         if lang == 'cn':
-            if event_type == 704:
+            if event_type == 51:
+                msg_type = '检测到画面变化'
+            elif event_type == 704:
                 msg_type = '剩余电量 ' + electricity
             elif event_type == 702:
                 msg_type = '摄像头休眠'
@@ -407,9 +409,11 @@ class DevicePushService:
                 if device_type in MULTI_CHANNEL_TYPE_LIST:
                     send_text = '{} 通道:{} 日期:{}'.format(msg_type, channel, n_date)
                 else:
-                    send_text = '{} 日期:{}'.format(msg_type, channel, n_date)
+                    send_text = '{} 日期:{}'.format(msg_type, n_date)
         else:
-            if event_type == 704:
+            if event_type == 51:
+                msg_type = 'Screen change detected'
+            elif event_type == 704:
                 msg_type = 'Battery remaining ' + electricity
             elif event_type == 702:
                 msg_type = 'Camera sleep'
@@ -439,7 +443,7 @@ class DevicePushService:
                 if device_type in MULTI_CHANNEL_TYPE_LIST:
                     send_text = '{} channel:{} date:{}'.format(msg_type, channel, n_date)
                 else:
-                    send_text = '{} date:{}'.format(msg_type, channel, n_date)
+                    send_text = '{} date:{}'.format(msg_type, n_date)
         return send_text
 
     @staticmethod