|
@@ -621,10 +621,10 @@ class deviceStatus(TemplateView):
|
|
return JsonResponse({'code': 111, 'msg': '参数异常'})
|
|
return JsonResponse({'code': 111, 'msg': '参数异常'})
|
|
skill_name = 'loocam'
|
|
skill_name = 'loocam'
|
|
try:
|
|
try:
|
|
- switch_qs = SwitchModel.objects.filter(serial_number=serial_number).values('serial_number', 'userID')
|
|
|
|
|
|
+ switch_qs = SwitchModel.objects.filter(serial_number=serial_number)
|
|
if not switch_qs.exists():
|
|
if not switch_qs.exists():
|
|
return JsonResponse({'code': 103, 'msg': '不存在socket数据'})
|
|
return JsonResponse({'code': 103, 'msg': '不存在socket数据'})
|
|
- userID = switch_qs[0]['userID']
|
|
|
|
|
|
+ userID = switch_qs[0].userID
|
|
alexAuth = AlexaAuthModel.objects.filter(userID=userID, skill_name=skill_name). \
|
|
alexAuth = AlexaAuthModel.objects.filter(userID=userID, skill_name=skill_name). \
|
|
values('expiresTime', 'refresh_token', 'access_token', 'alexa_region')
|
|
values('expiresTime', 'refresh_token', 'access_token', 'alexa_region')
|
|
if not alexAuth.exists():
|
|
if not alexAuth.exists():
|
|
@@ -655,7 +655,7 @@ class deviceStatus(TemplateView):
|
|
|
|
|
|
endpoints = []
|
|
endpoints = []
|
|
for switch in switch_qs:
|
|
for switch in switch_qs:
|
|
- endpointId = {"endpointId": switch['serial_number']}
|
|
|
|
|
|
+ endpointId = {"endpointId": switch.serial_number}
|
|
endpoints.append(endpointId)
|
|
endpoints.append(endpointId)
|
|
switch_qs.delete()
|
|
switch_qs.delete()
|
|
headers = {
|
|
headers = {
|