|
@@ -43,9 +43,12 @@ class DeviceReportView(View):
|
|
raise ValidationError('Invalid device UID format')
|
|
raise ValidationError('Invalid device UID format')
|
|
|
|
|
|
# 参数提取和类型转换
|
|
# 参数提取和类型转换
|
|
|
|
+ wake_sleep = self.parse_int_param(data, 'pirWakeupCount') + self.parse_int_param(data, 'mqttWakeupCount')
|
|
report_params = {
|
|
report_params = {
|
|
'human_detection': self.parse_int_param(data, 'humanDetection'),
|
|
'human_detection': self.parse_int_param(data, 'humanDetection'),
|
|
- 'wake_sleep': self.parse_int_param(data, 'wakeSleep'),
|
|
|
|
|
|
+ 'pir_wakeup_count': self.parse_int_param(data, 'pirWakeupCount'),
|
|
|
|
+ 'mqtt_wakeup_count': self.parse_int_param(data, 'mqttWakeupCount'),
|
|
|
|
+ 'wake_sleep': wake_sleep,
|
|
'working_hours': self.parse_int_param(data, 'workingHours'),
|
|
'working_hours': self.parse_int_param(data, 'workingHours'),
|
|
'battery_level': self.parse_int_param(data, 'batteryLevel'),
|
|
'battery_level': self.parse_int_param(data, 'batteryLevel'),
|
|
'report_time': self.parse_int_param(data, 'reportTime'),
|
|
'report_time': self.parse_int_param(data, 'reportTime'),
|