Skip to content

Commit

Permalink
Update ESP8266WiFi for Arduino 3.1.0+
Browse files Browse the repository at this point in the history
Behaviour changed in upstream "Initialize SoftAP DhcpServer object on demand"
esp8266/Arduino#8546
  • Loading branch information
vidplace7 committed Jan 16, 2023
1 parent 351ea04 commit 82927ff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions esphome/components/wifi/wifi_component_esp8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ extern "C" {
#define wifi_softap_set_dhcps_lease_time(time) dhcpSoftAP.set_dhcps_lease_time(time)
#define wifi_softap_set_dhcps_offer_option(offer, mode) dhcpSoftAP.set_dhcps_offer_option(offer, mode)
#endif
#if USE_ARDUINO_VERSION_CODE >= VERSION_CODE(3, 1, 0)
auto &dhcpServer = WiFi.softAPDhcpServer();
#define wifi_softap_set_dhcps_lease(lease) dhcpServer.set_dhcps_lease(lease)
#define wifi_softap_set_dhcps_lease_time(time) dhcpServer.set_dhcps_lease_time(time)
#define wifi_softap_set_dhcps_offer_option(offer, mode) dhcpServer.set_dhcps_offer_option(offer, mode)
#endif
}

#include "esphome/core/helpers.h"
Expand Down

0 comments on commit 82927ff

Please sign in to comment.