diff --git a/platformio/commands/device.py b/platformio/commands/device.py index 8b6dbd89..78bb7cdc 100644 --- a/platformio/commands/device.py +++ b/platformio/commands/device.py @@ -165,8 +165,10 @@ def device_monitor(**kwargs): # pylint: disable=too-many-branches kwargs['environment']) monitor_options = {k: v for k, v in project_options or []} if monitor_options: - for k in ("port", "baud", "rts", "dtr"): - k2 = "monitor_%s" % ("speed" if k == "baud" else k) + for k in ("port", "baud", "speed", "rts", "dtr"): + k2 = "monitor_%s" % k + if k == "speed": + k = "baud" if kwargs[k] is None and k2 in monitor_options: kwargs[k] = monitor_options[k2] if k != "port":