Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose flow_control paramater from zigpy #52

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ radio requires exclusive access to the hardware: if both are running at once, ne
Network commands require the radio type to be specified. See `zigpy radio --help` for the list of supported types.
If your radio requires a different baudrate than the radio library default (mainly EZSP), you must specify it as a command line option. For example, `zigpy radio --baudrate 115200 ezsp backup -`.

Similarly if a different flow control is required ("hardware" or "software"), this also must be specified, otherwise the driver default will be used (usually software flow control). For example, `zigpy radio --flow-control hardware znp backup -`.

## Network backup

```console
Expand Down
6 changes: 5 additions & 1 deletion zigpy_cli/radio.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
@click.argument("radio", type=click.Choice(list(RADIO_TO_PACKAGE.keys())))
@click.argument("port", type=str)
@click.option("--baudrate", type=int, default=None)
@click.option("--flow-control", type=click.Choice(["software", "hardware", "none"]), default=None)
oliv3r marked this conversation as resolved.
Show resolved Hide resolved
@click.option("--database", type=str, default=None)
@click_coroutine
async def radio(ctx, radio, port, baudrate=None, database=None):
async def radio(ctx, radio, port, baudrate=None, flow_control=None, database=None):
# Setup logging for the radio
verbose = ctx.parent.params["verbose"]
logging_configs = RADIO_LOGGING_CONFIGS[radio]
Expand Down Expand Up @@ -60,6 +61,9 @@ async def radio(ctx, radio, port, baudrate=None, database=None):
if baudrate is not None:
config["device"]["baudrate"] = baudrate

if flow_control == "hardware" or flow_control == "software":
config["device"]["flow_control"] = flow_control

app = radio_module.ControllerApplication(config)

ctx.obj = app
Expand Down