mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
login response
This commit is contained in:
parent
a15346339d
commit
ab39232cd1
1 changed files with 6 additions and 1 deletions
|
|
@ -570,12 +570,17 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
res = await mc.wait_for_event(EventType.LOGIN_SUCCESS)
|
res = await mc.wait_for_event(EventType.LOGIN_SUCCESS)
|
||||||
logger.debug(res)
|
logger.debug(res)
|
||||||
if res is None:
|
if res is None:
|
||||||
print("Timeout waiting login response")
|
print("Login failed : Timeout waiting response")
|
||||||
elif json_output :
|
elif json_output :
|
||||||
if res.type == EventType.LOGIN_SUCCESS:
|
if res.type == EventType.LOGIN_SUCCESS:
|
||||||
print(json.dumps({"login_success" : True}, indent=4))
|
print(json.dumps({"login_success" : True}, indent=4))
|
||||||
else:
|
else:
|
||||||
print(json.dumps({"login_success" : False}, indent=4))
|
print(json.dumps({"login_success" : False}, indent=4))
|
||||||
|
else:
|
||||||
|
if res.type == EventType.LOGIN_SUCCESS:
|
||||||
|
print("Login success")
|
||||||
|
else:
|
||||||
|
print("Login failed")
|
||||||
|
|
||||||
case "wait_status" | "ws" :
|
case "wait_status" | "ws" :
|
||||||
res = await mc.wait_for_event(EventType.STATUS_RESPONSE)
|
res = await mc.wait_for_event(EventType.STATUS_RESPONSE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue