rabin 8 年之前
父节点
当前提交
244a5824c2
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      service/device.py

+ 4 - 4
service/device.py

@@ -149,14 +149,14 @@ class Device(object):
 					type_model.id = type_id
 					type_info = type_model.select(type='fetchone')
 					if type_info['unit'] == 'button':
-						if switch == 1:
+						if switch == '1':
 							oper = '升起'
-						elif switch == 2:
+						elif switch == '2':
 							oper = '降下'
-						elif switch == 5:
+						elif switch == '5':
 							oper = '停止'
 					else:
-						if switch == 1:
+						if switch == '1':
 							oper = '开启'
 						else:
 							oper = '关闭'