mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
self telemetry
This commit is contained in:
parent
b524da69d0
commit
68d056809c
2 changed files with 17 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "meshcore-cli"
|
name = "meshcore-cli"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
||||||
]
|
]
|
||||||
|
|
@ -17,7 +17,7 @@ classifiers = [
|
||||||
]
|
]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
license-files = ["LICEN[CS]E*"]
|
license-files = ["LICEN[CS]E*"]
|
||||||
dependencies = [ "meshcore >= 1.9.9", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ]
|
dependencies = [ "meshcore >= 1.9.10", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
Homepage = "https://github.com/fdlamotte/meshcore-cli"
|
Homepage = "https://github.com/fdlamotte/meshcore-cli"
|
||||||
|
|
|
||||||
|
|
@ -246,6 +246,7 @@ def make_completion_dict(contacts, to=None):
|
||||||
"req_status" : contact_list,
|
"req_status" : contact_list,
|
||||||
"logout" : contact_list,
|
"logout" : contact_list,
|
||||||
"req_telemetry" : contact_list,
|
"req_telemetry" : contact_list,
|
||||||
|
"self_telemetry" : None,
|
||||||
"set" : {
|
"set" : {
|
||||||
"name" : None,
|
"name" : None,
|
||||||
"pin" : None,
|
"pin" : None,
|
||||||
|
|
@ -1152,6 +1153,19 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
else :
|
else :
|
||||||
print(json.dumps(res.payload, indent=4))
|
print(json.dumps(res.payload, indent=4))
|
||||||
|
|
||||||
|
case "self_telemetry" | "t":
|
||||||
|
res = await mc.commands.get_self_telemetry()
|
||||||
|
logger.debug(res)
|
||||||
|
if res.type == EventType.ERROR:
|
||||||
|
print(f"Error while requesting telemetry")
|
||||||
|
elif res is None:
|
||||||
|
if json_output :
|
||||||
|
print(json.dumps({"error" : "Timeout waiting telemetry"}))
|
||||||
|
else:
|
||||||
|
print("Timeout waiting telemetry")
|
||||||
|
else :
|
||||||
|
print(json.dumps(res.payload, indent=4))
|
||||||
|
|
||||||
case "req_telemetry" | "rt" :
|
case "req_telemetry" | "rt" :
|
||||||
argnum = 1
|
argnum = 1
|
||||||
await mc.ensure_contacts()
|
await mc.ensure_contacts()
|
||||||
|
|
@ -1556,6 +1570,7 @@ def command_help():
|
||||||
chat_to <ct> : enter chat with contact to
|
chat_to <ct> : enter chat with contact to
|
||||||
script <filename> : execute commands in filename
|
script <filename> : execute commands in filename
|
||||||
infos : print informations about the node i
|
infos : print informations about the node i
|
||||||
|
self_telemetry : print own telemtry t
|
||||||
card : export this node URI e
|
card : export this node URI e
|
||||||
ver : firmware version v
|
ver : firmware version v
|
||||||
reboot : reboots node
|
reboot : reboots node
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue