From 387c75793bf03b7e764935bfa82d5459897ba920 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Tue, 5 Nov 2019 22:11:15 +0100 Subject: [PATCH] WiFi AP apply manual ip settings (#836) --- esphome/components/wifi/__init__.py | 3 ++- esphome/components/wifi/wifi_component_esp8266.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index 93f2d59564..818d3c84e0 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -179,7 +179,8 @@ def to_code(config): if CONF_AP in config: conf = config[CONF_AP] - cg.add(var.set_ap(wifi_network(conf, config.get(CONF_MANUAL_IP)))) + ip_config = conf.get(CONF_MANUAL_IP, config.get(CONF_MANUAL_IP)) + cg.add(var.set_ap(wifi_network(conf, ip_config))) cg.add(var.set_ap_timeout(conf[CONF_AP_TIMEOUT])) cg.add(var.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT])) diff --git a/esphome/components/wifi/wifi_component_esp8266.cpp b/esphome/components/wifi/wifi_component_esp8266.cpp index e218a12907..ff0dd57ed4 100644 --- a/esphome/components/wifi/wifi_component_esp8266.cpp +++ b/esphome/components/wifi/wifi_component_esp8266.cpp @@ -566,7 +566,7 @@ bool WiFiComponent::wifi_start_ap_(const WiFiAP &ap) { strcpy(reinterpret_cast(conf.ssid), ap.get_ssid().c_str()); conf.ssid_len = static_cast(ap.get_ssid().size()); conf.channel = ap.get_channel().value_or(1); - conf.ssid_hidden = 0; + conf.ssid_hidden = ap.get_hidden(); conf.max_connection = 5; conf.beacon_interval = 100;