patch esphome cli to skip mqtt based device discovery if --device option is specified (#6371)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Matt Quigley 2024-04-28 14:57:11 -05:00 committed by GitHub
parent 9ea442f328
commit e7c1ddb452
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -343,9 +343,10 @@ def upload_program(config, args, host):
password = ota_conf.get(CONF_PASSWORD, "")
if (
not is_ip_address(CORE.address)
not is_ip_address(CORE.address) # pylint: disable=too-many-boolean-expressions
and (get_port_type(host) == "MQTT" or config[CONF_MDNS][CONF_DISABLED])
and CONF_MQTT in config
and (not args.device or args.device == "MQTT")
):
from esphome import mqtt