1
0

2 Коміти df4d93c883 ... a35733dce0

Автор SHA1 Опис Дата
  zhangdongming a35733dce0 电池电量上报带通道号 1 тиждень тому
  locky 8c4dad5d09 优化fcm推送结果打印 1 тиждень тому
2 змінених файлів з 4 додано та 3 видалено
  1. 2 1
      Controller/DeviceReportController.py
  2. 2 2
      Service/PushService.py

+ 2 - 1
Controller/DeviceReportController.py

@@ -52,7 +52,8 @@ class DeviceReportView(View):
                 'wake_sleep': wake_sleep,
                 'working_hours': self.parse_int_param(data, 'workingHours'),
                 'battery_level': self.parse_int_param(data, 'batteryLevel'),
-                'report_time': self.parse_int_param(data, 'reportTime') - 10800,
+                'report_time': self.parse_int_param(data, 'reportTime') - 3600,
+                'channel': int(data.get('channel', 1))
             }
 
             # 时间戳验证

+ 2 - 2
Service/PushService.py

@@ -242,10 +242,10 @@ class PushObject:
             # Send a message to the device corresponding to the provided
             # registration token.
             result = messaging.send(message)
-            LOGGER.info('fcm推送结果:{}'.format(result))
+            LOGGER.info('uid:{}fcm推送结果:{}'.format(uid, result))
             return True
         except Exception as e:
-            LOGGER.info('fcm推送异常:{}'.format(repr(e)))
+            LOGGER.info('uid:{}fcm推送异常:{}'.format(uid, repr(e)))
             return False
 
     @staticmethod