mirror of
https://github.com/esphome/esphome.git
synced 2024-12-24 16:58:07 +01:00
WiFi AP apply manual ip settings (#836)
This commit is contained in:
parent
0cbd373817
commit
85c46becdf
@ -179,7 +179,8 @@ def to_code(config):
|
|||||||
|
|
||||||
if CONF_AP in config:
|
if CONF_AP in config:
|
||||||
conf = config[CONF_AP]
|
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_ap_timeout(conf[CONF_AP_TIMEOUT]))
|
||||||
|
|
||||||
cg.add(var.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT]))
|
cg.add(var.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT]))
|
||||||
|
@ -566,7 +566,7 @@ bool WiFiComponent::wifi_start_ap_(const WiFiAP &ap) {
|
|||||||
strcpy(reinterpret_cast<char *>(conf.ssid), ap.get_ssid().c_str());
|
strcpy(reinterpret_cast<char *>(conf.ssid), ap.get_ssid().c_str());
|
||||||
conf.ssid_len = static_cast<uint8>(ap.get_ssid().size());
|
conf.ssid_len = static_cast<uint8>(ap.get_ssid().size());
|
||||||
conf.channel = ap.get_channel().value_or(1);
|
conf.channel = ap.get_channel().value_or(1);
|
||||||
conf.ssid_hidden = 0;
|
conf.ssid_hidden = ap.get_hidden();
|
||||||
conf.max_connection = 5;
|
conf.max_connection = 5;
|
||||||
conf.beacon_interval = 100;
|
conf.beacon_interval = 100;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user