|
@@ -55,16 +55,16 @@ class Device(object):
|
|
model = Demeter.model('device_info')
|
|
model = Demeter.model('device_info')
|
|
model.id = device_id
|
|
model.id = device_id
|
|
info = model.select(type='fetchone')
|
|
info = model.select(type='fetchone')
|
|
|
|
+ # 如果有批量控制,还要保存mul的id
|
|
|
|
+ if mul:
|
|
|
|
+ model = Demeter.model('device_mul_queue')
|
|
|
|
+ model.mul_id = mul
|
|
|
|
+ model.device_id = info['id']
|
|
|
|
+ model.insert()
|
|
if info and info['status'] == True:
|
|
if info and info['status'] == True:
|
|
# 设置为loading状态,cxnum保存当前的值
|
|
# 设置为loading状态,cxnum保存当前的值
|
|
model.id = device_id
|
|
model.id = device_id
|
|
model.update(exp='-1', cxnum=switch)
|
|
model.update(exp='-1', cxnum=switch)
|
|
- # 如果有批量控制,还要保存mul的id
|
|
|
|
- if mul:
|
|
|
|
- model = Demeter.model('device_mul_queue')
|
|
|
|
- model.mul_id = mul
|
|
|
|
- model.device_id = info['id']
|
|
|
|
- model.insert()
|
|
|
|
|
|
|
|
model = Demeter.model('device_gateway')
|
|
model = Demeter.model('device_gateway')
|
|
model.id = info['gateway_id']
|
|
model.id = info['gateway_id']
|