|
@@ -78,8 +78,11 @@ def update_device_shadow(request):
|
|
logger = logging.getLogger('info')
|
|
logger = logging.getLogger('info')
|
|
logger.info('使用配置: {}'.format(SERVER_TYPE))
|
|
logger.info('使用配置: {}'.format(SERVER_TYPE))
|
|
logger.info('data: {}'.format(request_dict.dict()))
|
|
logger.info('data: {}'.format(request_dict.dict()))
|
|
- if SERVER_TYPE != 'Ansjer.cn_formal_settings':
|
|
|
|
- requests.post(url='http://shadow.zositechc.cn/deviceShadow/update', data=request_dict.dict(), timeout=2)
|
|
|
|
|
|
+
|
|
|
|
+ if SERVER_TYPE != 'Ansjer.test_settings':
|
|
|
|
+ if SERVER_TYPE != 'Ansjer.cn_formal_settings': # 同步更新国内数据
|
|
|
|
+ requests.post(url='http://shadow.zositechc.cn/deviceShadow/update', data=request_dict.dict(), timeout=2)
|
|
|
|
+
|
|
nowTime = int(time.time())
|
|
nowTime = int(time.time())
|
|
|
|
|
|
# 重置按钮
|
|
# 重置按钮
|
|
@@ -181,4 +184,5 @@ def update_device_shadow(request):
|
|
# 如果推送状态开启,返回推送url
|
|
# 如果推送状态开启,返回推送url
|
|
return JsonResponse(status=200, data={'code': 0, 'msg': 'success', 'data': {}})
|
|
return JsonResponse(status=200, data={'code': 0, 'msg': 'success', 'data': {}})
|
|
except Exception as e:
|
|
except Exception as e:
|
|
|
|
+ logger.info('更新设备影子异常: {}'.format(repr(e)))
|
|
return JsonResponse(status=500, data={'update_shadow_error': repr(e)})
|
|
return JsonResponse(status=500, data={'update_shadow_error': repr(e)})
|