mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 01:08:03 +01:00
Dont do mqtt ip lookup if use_address
has ip address (#5096)
* Dont do mqtt ip lookup id `use_address` is in config * Fix after actually testing =)
This commit is contained in:
parent
3ba2a29e54
commit
d7945de001
1 changed files with 5 additions and 3 deletions
|
@ -32,7 +32,7 @@ from esphome.const import (
|
||||||
SECRETS_FILES,
|
SECRETS_FILES,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, EsphomeError, coroutine
|
from esphome.core import CORE, EsphomeError, coroutine
|
||||||
from esphome.helpers import indent
|
from esphome.helpers import indent, is_ip_address
|
||||||
from esphome.util import (
|
from esphome.util import (
|
||||||
run_external_command,
|
run_external_command,
|
||||||
run_external_process,
|
run_external_process,
|
||||||
|
@ -308,8 +308,10 @@ def upload_program(config, args, host):
|
||||||
password = ota_conf.get(CONF_PASSWORD, "")
|
password = ota_conf.get(CONF_PASSWORD, "")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
get_port_type(host) == "MQTT" or config[CONF_MDNS][CONF_DISABLED]
|
not is_ip_address(CORE.address)
|
||||||
) and CONF_MQTT in config:
|
and (get_port_type(host) == "MQTT" or config[CONF_MDNS][CONF_DISABLED])
|
||||||
|
and CONF_MQTT in config
|
||||||
|
):
|
||||||
from esphome import mqtt
|
from esphome import mqtt
|
||||||
|
|
||||||
host = mqtt.get_esphome_device_ip(
|
host = mqtt.get_esphome_device_ip(
|
||||||
|
|
Loading…
Reference in a new issue