Skip to content

Commit 872e6b3

Browse files
committed
Expose flow_control paramater from zigpy
Certain boards (such as the Sonoff Zigbee 3.0 USB Dongle Plus P) have a hardware switch that allows for turning on hardware flow control (given the correct firmware is flashed). This requires of course that zigpy-cli also allows for setting this flag to be able to communicate with the dongle. Zigpy and zigpy-znp already support hardware flow control fully. No wit is time that zigpy-cli also offers this option. Signed-off-by: Olliver Schinagl <[email protected]>
1 parent e13497f commit 872e6b3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ radio requires exclusive access to the hardware: if both are running at once, ne
3333
Network commands require the radio type to be specified. See `zigpy radio --help` for the list of supported types.
3434
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 -`.
3535

36+
Similarly if a different flow control is required ("hardware" for rtscts or "software" for xonxoff), 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 -`.
37+
3638
## Network backup
3739

3840
```console

zigpy_cli/radio.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
@click.argument("radio", type=click.Choice(list(RADIO_TO_PACKAGE.keys())))
2626
@click.argument("port", type=str)
2727
@click.option("--baudrate", type=int, default=None)
28+
@click.option("--flow-control", type=click.Choice(["software", "hardware", "none"]), default=None)
2829
@click.option("--database", type=str, default=None)
2930
@click_coroutine
30-
async def radio(ctx, radio, port, baudrate=None, database=None):
31+
async def radio(ctx, radio, port, baudrate=None, flow_control=None, database=None):
3132
# Setup logging for the radio
3233
verbose = ctx.parent.params["verbose"]
3334
logging_configs = RADIO_LOGGING_CONFIGS[radio]
@@ -60,6 +61,9 @@ async def radio(ctx, radio, port, baudrate=None, database=None):
6061
if baudrate is not None:
6162
config["device"]["baudrate"] = baudrate
6263

64+
if flow_control is not None:
65+
config["device"]["flow_control"] = flow_control
66+
6367
app = radio_module.ControllerApplication(config)
6468

6569
ctx.obj = app

0 commit comments

Comments
 (0)