diff --git a/pyproject.toml b/pyproject.toml index ddcf488..7c0802e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore-cli" -version = "1.1.15" +version = "1.1.16" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, ] @@ -17,7 +17,7 @@ classifiers = [ ] license = "MIT" license-files = ["LICEN[CS]E*"] -dependencies = [ "meshcore >= 2.1.2", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ] +dependencies = [ "meshcore >= 2.1.3", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ] [project.urls] Homepage = "https://github.com/fdlamotte/meshcore-cli" diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 0a7b77f..853221a 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -23,7 +23,7 @@ from prompt_toolkit.shortcuts import radiolist_dialog from meshcore import MeshCore, EventType, logger # Version -VERSION = "v1.1.15" +VERSION = "v1.1.16" # default ble address is stored in a config file MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/" @@ -733,7 +733,13 @@ Line starting with \"$\" or \".\" will issue a meshcli command. cmds = shlex.split(line) off = 1 if line.startswith("set perm") else 0 name = cmds[1 + off] - perm = int(cmds[2 + off],0) + perm_string = cmds[2 + off] + if (perm_string.startswith("0x")): + perm = int(perm_string,0) + elif (perm_string.startswith("#")): + perm = int(perm_string[1:]) + else: + perm = int(perm_string,16) ct=mc.get_contact_by_name(name) if ct is None: ct=mc.get_contact_by_key_prefix(name)