1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-14 06:38:17 +00:00

Centralised default parameter for domain.

This commit is contained in:
Jimmy Hedman 2018-05-21 15:21:22 +02:00
parent 19363ee46d
commit c051e0ece0
2 changed files with 4 additions and 4 deletions

View File

@ -163,13 +163,13 @@ def upload_program(config, args, port):
_LOGGER.error("No serial port found and OTA not enabled. Can't upload!")
return -1
DOMAIN = '.' + config[CONF_WIFI].get(CONF_DOMAIN, 'local')
domain = '.' + config[CONF_WIFI][CONF_DOMAIN]
if CONF_MANUAL_IP in config[CONF_WIFI]:
host = str(config[CONF_WIFI][CONF_MANUAL_IP][CONF_STATIC_IP])
elif CONF_HOSTNAME in config[CONF_WIFI]:
host = config[CONF_WIFI][CONF_HOSTNAME] + DOMAIN
host = config[CONF_WIFI][CONF_HOSTNAME] + domain
else:
host = config[CONF_ESPHOMEYAML][CONF_NAME] + DOMAIN
host = config[CONF_ESPHOMEYAML][CONF_NAME] + domain
from esphomeyaml.components import ota
from esphomeyaml import espota

View File

@ -42,7 +42,7 @@ CONFIG_SCHEMA = vol.Schema({
vol.Optional(CONF_MANUAL_IP): AP_MANUAL_IP_SCHEMA,
}),
vol.Optional(CONF_HOSTNAME): cv.hostname,
vol.Optional(CONF_DOMAIN): cv.string,
vol.Required(CONF_DOMAIN, default='local'): cv.string,
})
# pylint: disable=invalid-name