mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
auto channel support
This commit is contained in:
parent
b18804f4cc
commit
48821e92d0
2 changed files with 8 additions and 4 deletions
|
|
@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "meshcore-cli"
|
name = "meshcore-cli"
|
||||||
version = "1.1.22"
|
version = "1.1.23"
|
||||||
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 >= 2.1.6", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0" ]
|
dependencies = [ "meshcore >= 2.1.7", "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"
|
||||||
|
|
|
||||||
|
|
@ -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.22"
|
VERSION = "v1.1.23"
|
||||||
|
|
||||||
# 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/"
|
||||||
|
|
@ -1413,7 +1413,11 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
|
|
||||||
case "set_channel":
|
case "set_channel":
|
||||||
argnum = 3
|
argnum = 3
|
||||||
res = await mc.commands.set_channel(int(cmds[1]), cmds[2], bytes.fromhex(cmds[3]))
|
if cmds[2].startswith("#") or len(cmds) == 3:
|
||||||
|
argnum = 2
|
||||||
|
res = await mc.commands.set_channel(int(cmds[1]), cmds[2])
|
||||||
|
else:
|
||||||
|
res = await mc.commands.set_channel(int(cmds[1]), cmds[2], bytes.fromhex(cmds[3]))
|
||||||
logger.debug(res)
|
logger.debug(res)
|
||||||
if res.type == EventType.ERROR:
|
if res.type == EventType.ERROR:
|
||||||
print(f"Error while setting channel")
|
print(f"Error while setting channel")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue