feat: get_tyy_data优化2
This commit is contained in:
parent
1d7c2ebb35
commit
518379ea35
|
|
@ -17,7 +17,7 @@ def get_tyy_data(*args):
|
||||||
resp = sc.recv(1024)
|
resp = sc.recv(1024)
|
||||||
if not resp:
|
if not resp:
|
||||||
raise ParseError("采集器返回空数据")
|
raise ParseError("采集器返回空数据")
|
||||||
if len(resp) < 8:
|
elif len(resp) < 8:
|
||||||
raise ParseError("设备未启动")
|
raise ParseError("设备未启动")
|
||||||
json_data = resp[5:-4]
|
json_data = resp[5:-4]
|
||||||
json_str = json_data.decode('utf-8')
|
json_str = json_data.decode('utf-8')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue