|
@@ -92,7 +92,7 @@ class Device(object):
|
|
|
msg = self.notice('offline')
|
|
|
model.id = device_id
|
|
|
model.update(exp=msg, cxnum=switch)
|
|
|
- self.mul(info['id'], info['name'], switch, '失败:' + msg, False)
|
|
|
+ self.mul(info['id'], info['type_id'], info['name'], switch, '失败:' + msg, False)
|
|
|
|
|
|
|
|
|
|
|
@@ -110,7 +110,7 @@ class Device(object):
|
|
|
model.update(value=param['switch'], exp='1')
|
|
|
|
|
|
|
|
|
- self.mul(info['id'], info['name'], param['switch'], '成功', True)
|
|
|
+ self.mul(info['id'], info['type_id'], info['name'], param['switch'], '成功', True)
|
|
|
else:
|
|
|
msg = self.notice(msg)
|
|
|
model = Demeter.model('device_info')
|
|
@@ -118,7 +118,7 @@ class Device(object):
|
|
|
model.update(exp=msg)
|
|
|
|
|
|
|
|
|
- self.mul(info['id'], info['name'], param['switch'], '失败:' + msg, False)
|
|
|
+ self.mul(info['id'], info['type_id'], info['name'], param['switch'], '失败:' + msg, False)
|
|
|
|
|
|
content = oper + gateway['name'] + '下的'+ info['name'] + '失败,错误提示:' + msg
|
|
|
Demeter.service('record').msg(info['id'], content, info['farm_id'], 3)
|
|
@@ -133,7 +133,7 @@ class Device(object):
|
|
|
msg = info['name']
|
|
|
return msg
|
|
|
|
|
|
- def mul(self, id, name, switch, msg, state):
|
|
|
+ def mul(self, id, type_id, name, switch, msg, state):
|
|
|
model = Demeter.model('device_mul_queue')
|
|
|
model.device_id = id
|
|
|
queue = model.select()
|
|
@@ -146,7 +146,7 @@ class Device(object):
|
|
|
for v in queue:
|
|
|
model.id = v['mul_id']
|
|
|
type_model = Demeter.model('device_type')
|
|
|
- type_model.id = info['type_id']
|
|
|
+ type_model.id = type_id
|
|
|
type_info = type_model.select(type='fetchone')
|
|
|
if type_info['unit'] == 'button':
|
|
|
if switch == 1:
|