Kaynağa Gözat

重复添加子设备更新短地址

locky 3 yıl önce
ebeveyn
işleme
9585d74745

+ 1 - 0
Controller/SensorGateway/SubDeviceController.py

@@ -101,6 +101,7 @@ class GatewaySubDeviceView(View):
             # 查询是否已添加过该子设备
             sub_device_qs = GatewaySubDevice.objects.filter(device_id=device_id, ieee_addr=ieee_addr)
             if sub_device_qs.exists():
+                sub_device_qs.update(src_addr=src_addr)     # 更新短地址
                 return response.json(174)
 
             with transaction.atomic():