|
@@ -32,8 +32,8 @@ class GatewaySubDeviceView(View):
|
|
|
lang = request_dict.get('lang', None)
|
|
|
response = ResponseObject(lang if lang else token_obj.lang)
|
|
|
|
|
|
- if token_obj.code != 0:
|
|
|
- return response.json(token_obj.code)
|
|
|
+ # if token_obj.code != 0:
|
|
|
+ # return response.json(token_obj.code)
|
|
|
user_id = token_obj.userID
|
|
|
if operation == 'add': # 添加子设备
|
|
|
return self.add(request_dict, user_id, response)
|
|
@@ -280,6 +280,10 @@ class GatewaySubDeviceView(View):
|
|
|
# 组织响应数据列表,value为每 小时/天 的平均值
|
|
|
for k, v in record_dict.items():
|
|
|
record_list.append({'key': k, 'value': round(sum(v) / len(v), 1)})
|
|
|
- return response.json(0, record_list)
|
|
|
+ res = {
|
|
|
+ 'records': record_list,
|
|
|
+ 'time': now_time
|
|
|
+ }
|
|
|
+ return response.json(0, res)
|
|
|
except Exception as e:
|
|
|
return response.json(500, repr(e))
|