Browse Source

同一网关只能绑定一个智能按钮 修改提示语

peng 2 năm trước cách đây
mục cha
commit
f6f0c64d2e

+ 1 - 1
Controller/SensorGateway/SubDeviceController.py

@@ -109,7 +109,7 @@ class GatewaySubDeviceView(View):
             if device_type == SENSOR_TYPE['smart_button']:
                 sub_device_qs = GatewaySubDevice.objects.filter(device_id=device_id, device_type=device_type)
                 if sub_device_qs.exists():
-                    return response.json(174)
+                    return response.json(181)
 
             with transaction.atomic():
                 sub_device = GatewaySubDevice.objects.create(device_id=device_id, device_type=device_type,

+ 2 - 0
Object/ResponseObject.py

@@ -44,6 +44,7 @@ class ResponseObject(object):
             178: 'ADD error',
             179: 'Nickname repeated',
             180: 'Smart button scene trigger conditions cannot be repeated',
+            181: 'The gateway have bound smart button',
             201: 'You can only add 3 custom voice at most',
             306: 'The link has expired!',
             309: 'Please ReLogin! errmsg token',
@@ -153,6 +154,7 @@ class ResponseObject(object):
             178: '增加错误',
             179: '名称不能重复',
             180: '智能按钮场景触发条件不能重复',
+            181: '该网关已绑定智能按钮',
             201: '最多只能添加3条自定义语音',
             306: '链接已超过有效期!',
             309: '请重新登录!',