|
23 | 23 | from meshcore import MeshCore, EventType, logger |
24 | 24 |
|
25 | 25 | # Version |
26 | | -VERSION = "v1.1.26" |
| 26 | +VERSION = "v1.1.27" |
27 | 27 |
|
28 | 28 | # default ble address is stored in a config file |
29 | 29 | MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/" |
@@ -355,6 +355,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None): |
355 | 355 | "change_flags" : contact_list, |
356 | 356 | "remove_contact" : contact_list, |
357 | 357 | "import_contact" : {"meshcore://":None}, |
| 358 | + "reload_contacts" : None, |
358 | 359 | "login" : contact_list, |
359 | 360 | "cmd" : contact_list, |
360 | 361 | "req_status" : contact_list, |
@@ -1827,6 +1828,17 @@ async def next_cmd(mc, cmds, json_output=False): |
1827 | 1828 | else : |
1828 | 1829 | for c in res.items(): |
1829 | 1830 | print(c[1]["adv_name"]) |
| 1831 | + print(f"> {len(mc.contacts)} contacts in device") |
| 1832 | + |
| 1833 | + case "reload_contacts" | "rc": |
| 1834 | + await mc.commands.get_contacts() |
| 1835 | + res = mc.contacts |
| 1836 | + if json_output : |
| 1837 | + print(json.dumps(res, indent=4)) |
| 1838 | + else : |
| 1839 | + for c in res.items(): |
| 1840 | + print(c[1]["adv_name"]) |
| 1841 | + print(f"> {len(mc.contacts)} contacts in device") |
1830 | 1842 |
|
1831 | 1843 | case "pending_contacts": |
1832 | 1844 | if json_output: |
@@ -2245,6 +2257,7 @@ def command_help(): |
2245 | 2257 | clock sync : sync device clock st |
2246 | 2258 | Contacts |
2247 | 2259 | contacts / list : gets contact list lc |
| 2260 | + reload_contacts : force reloading all contacts rc |
2248 | 2261 | contact_info <ct> : prints information for contact ct ci |
2249 | 2262 | contact_timeout <ct> v : sets temp default timeout for contact |
2250 | 2263 | share_contact <ct> : share a contact with others sc |
|
0 commit comments