Skip to content

Commit ececb3a

Browse files
committed
multi_acks
1 parent 80b6a6e commit ececb3a

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "meshcore-cli"
7-
version = "1.1.39"
7+
version = "1.1.40"
88
authors = [
99
{ name="Florent de Lamotte", email="[email protected]" },
1010
]
@@ -17,7 +17,7 @@ classifiers = [
1717
]
1818
license = "MIT"
1919
license-files = ["LICEN[CS]E*"]
20-
dependencies = [ "meshcore >= 2.1.17", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ]
20+
dependencies = [ "meshcore >= 2.1.19", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ]
2121

2222
[project.urls]
2323
Homepage = "https://github.com/fdlamotte/meshcore-cli"

src/meshcore_cli/meshcore_cli.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from meshcore import MeshCore, EventType, logger
2424

2525
# Version
26-
VERSION = "v1.1.39"
26+
VERSION = "v1.1.40"
2727

2828
# default ble address is stored in a config file
2929
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
@@ -398,6 +398,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
398398
"telemetry_mode_env" : {"always" : None, "device":None, "never":None},
399399
"advert_loc_policy" : {"none" : None, "share" : None},
400400
"auto_update_contacts" : {"on":None, "off":None},
401+
"multi_acks" : {"on": None, "off":None},
401402
"max_attempts" : None,
402403
"max_flood_attempts" : None,
403404
"flood_after" : None,
@@ -424,6 +425,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
424425
"telemetry_mode_env":None,
425426
"advert_loc_policy":None,
426427
"auto_update_contacts":None,
428+
"multi_acks":None,
427429
"max_attempts":None,
428430
"max_flood_attempts":None,
429431
"flood_after":None,
@@ -1389,6 +1391,13 @@ async def next_cmd(mc, cmds, json_output=False):
13891391
print(f"Error : {res}")
13901392
else :
13911393
print(f"manual add contact: {mac}")
1394+
case "multi_acks":
1395+
ma = (cmds[2] == "on") or (cmds[2] == "true") or (cmds[2] == "yes") or (cmds[2] == "1")
1396+
res = await mc.commands.set_multi_acks(ma)
1397+
if res.type == EventType.ERROR:
1398+
print(f"Error : {res}")
1399+
else :
1400+
print(f"multi_acks: {ma}")
13921401
case "auto_update_contacts":
13931402
auc = (cmds[2] == "on") or (cmds[2] == "true") or (cmds[2] == "yes") or (cmds[2] == "1")
13941403
mc.auto_update_contacts=auc
@@ -1579,6 +1588,12 @@ async def next_cmd(mc, cmds, json_output=False):
15791588
print(json.dumps(res.payload, indent=4))
15801589
else:
15811590
print(f"Using {res.payload['used_kb']}kB of {res.payload['total_kb']}kB")
1591+
case "multi_acks" :
1592+
await mc.commands.send_appstart()
1593+
if json_output :
1594+
print(json.dumps({"multi_acks" : mc.self_info["multi_acks"]}))
1595+
else :
1596+
print(f"multi_acks: {mc.self_info['multi_acks']}")
15821597
case "manual_add_contacts" :
15831598
await mc.commands.send_appstart()
15841599
if json_output :

0 commit comments

Comments
 (0)