|
@@ -214,16 +214,16 @@ class GatewayDeviceView(View):
|
|
return response.json(10044)
|
|
return response.json(10044)
|
|
time.sleep(0.3)
|
|
time.sleep(0.3)
|
|
# 重置设备
|
|
# 重置设备
|
|
- msg = {
|
|
|
|
- 'zigbee': 'recover',
|
|
|
|
- }
|
|
|
|
- success = CommonService.req_publish_mqtt_msg(serial_number, topic_name, msg)
|
|
|
|
- try:
|
|
|
|
- assert success
|
|
|
|
- except AssertionError:
|
|
|
|
- return response.json(10044)
|
|
|
|
- time.sleep(0.3)
|
|
|
|
- LOGGER.info('删除重置设备成功,参数为:{}'.format(request_dict))
|
|
|
|
|
|
+ # msg = {
|
|
|
|
+ # 'zigbee': 'recover',
|
|
|
|
+ # }
|
|
|
|
+ # success = CommonService.req_publish_mqtt_msg(serial_number, topic_name, msg)
|
|
|
|
+ # try:
|
|
|
|
+ # assert success
|
|
|
|
+ # except AssertionError:
|
|
|
|
+ # return response.json(10044)
|
|
|
|
+ # time.sleep(0.3)
|
|
|
|
+ # LOGGER.info('删除重置设备成功,参数为:{}'.format(request_dict))
|
|
else:
|
|
else:
|
|
smart_scene_qs = SmartScene.objects.filter(device_id=device_id)
|
|
smart_scene_qs = SmartScene.objects.filter(device_id=device_id)
|
|
if smart_scene_qs.exists():
|
|
if smart_scene_qs.exists():
|
|
@@ -273,16 +273,16 @@ class GatewayDeviceView(View):
|
|
return response.json(10044)
|
|
return response.json(10044)
|
|
time.sleep(0.3)
|
|
time.sleep(0.3)
|
|
# 重置设备
|
|
# 重置设备
|
|
- msg = {
|
|
|
|
- 'zigbee': 'recover',
|
|
|
|
- }
|
|
|
|
- success = CommonService.req_publish_mqtt_msg(serial_number, topic_name, msg)
|
|
|
|
- try:
|
|
|
|
- assert success
|
|
|
|
- except AssertionError:
|
|
|
|
- return response.json(10044)
|
|
|
|
- time.sleep(0.3)
|
|
|
|
- LOGGER.info('删除重置设备成功,参数为:{}'.format(request_dict))
|
|
|
|
|
|
+ # msg = {
|
|
|
|
+ # 'zigbee': 'recover',
|
|
|
|
+ # }
|
|
|
|
+ # success = CommonService.req_publish_mqtt_msg(serial_number, topic_name, msg)
|
|
|
|
+ # try:
|
|
|
|
+ # assert success
|
|
|
|
+ # except AssertionError:
|
|
|
|
+ # return response.json(10044)
|
|
|
|
+ # time.sleep(0.3)
|
|
|
|
+ # LOGGER.info('删除重置设备成功,参数为:{}'.format(request_dict))
|
|
# 删除场景,下发MQTT通知设备
|
|
# 删除场景,下发MQTT通知设备
|
|
smart_scene_qs = SmartScene.objects.filter(sub_device_id__in=sub_id_list)
|
|
smart_scene_qs = SmartScene.objects.filter(sub_device_id__in=sub_id_list)
|
|
if smart_scene_qs.exists():
|
|
if smart_scene_qs.exists():
|