mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
add reload_contacts command and show contacts count
This commit is contained in:
parent
875f5a7d1b
commit
f8fbec0ebe
2 changed files with 15 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "meshcore-cli"
|
name = "meshcore-cli"
|
||||||
version = "1.1.26"
|
version = "1.1.27"
|
||||||
authors = [
|
authors = [
|
||||||
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
{ name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ from prompt_toolkit.shortcuts import radiolist_dialog
|
||||||
from meshcore import MeshCore, EventType, logger
|
from meshcore import MeshCore, EventType, logger
|
||||||
|
|
||||||
# Version
|
# Version
|
||||||
VERSION = "v1.1.26"
|
VERSION = "v1.1.27"
|
||||||
|
|
||||||
# default ble address is stored in a config file
|
# default ble address is stored in a config file
|
||||||
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
|
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
|
||||||
|
|
@ -355,6 +355,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
|
||||||
"change_flags" : contact_list,
|
"change_flags" : contact_list,
|
||||||
"remove_contact" : contact_list,
|
"remove_contact" : contact_list,
|
||||||
"import_contact" : {"meshcore://":None},
|
"import_contact" : {"meshcore://":None},
|
||||||
|
"reload_contacts" : None,
|
||||||
"login" : contact_list,
|
"login" : contact_list,
|
||||||
"cmd" : contact_list,
|
"cmd" : contact_list,
|
||||||
"req_status" : contact_list,
|
"req_status" : contact_list,
|
||||||
|
|
@ -1827,6 +1828,17 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
else :
|
else :
|
||||||
for c in res.items():
|
for c in res.items():
|
||||||
print(c[1]["adv_name"])
|
print(c[1]["adv_name"])
|
||||||
|
print(f"> {len(mc.contacts)} contacts in device")
|
||||||
|
|
||||||
|
case "reload_contacts" | "rc":
|
||||||
|
await mc.commands.get_contacts()
|
||||||
|
res = mc.contacts
|
||||||
|
if json_output :
|
||||||
|
print(json.dumps(res, indent=4))
|
||||||
|
else :
|
||||||
|
for c in res.items():
|
||||||
|
print(c[1]["adv_name"])
|
||||||
|
print(f"> {len(mc.contacts)} contacts in device")
|
||||||
|
|
||||||
case "pending_contacts":
|
case "pending_contacts":
|
||||||
if json_output:
|
if json_output:
|
||||||
|
|
@ -2245,6 +2257,7 @@ def command_help():
|
||||||
clock sync : sync device clock st
|
clock sync : sync device clock st
|
||||||
Contacts
|
Contacts
|
||||||
contacts / list : gets contact list lc
|
contacts / list : gets contact list lc
|
||||||
|
reload_contacts : force reloading all contacts rc
|
||||||
contact_info <ct> : prints information for contact ct ci
|
contact_info <ct> : prints information for contact ct ci
|
||||||
contact_timeout <ct> v : sets temp default timeout for contact
|
contact_timeout <ct> v : sets temp default timeout for contact
|
||||||
share_contact <ct> : share a contact with others sc
|
share_contact <ct> : share a contact with others sc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue