mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-02 19:08:54 +02:00
Refactor ip address representation (#5252)
This commit is contained in:
@@ -30,11 +30,10 @@ void WakeOnLanButton::press_action() {
|
||||
ESP_LOGI(TAG, "Sending Wake-on-LAN Packet...");
|
||||
bool begin_status = false;
|
||||
bool end_status = false;
|
||||
uint32_t interface = esphome::network::get_ip_address();
|
||||
IPAddress interface_ip = IPAddress(interface);
|
||||
IPAddress broadcast = IPAddress(255, 255, 255, 255);
|
||||
#ifdef USE_ESP8266
|
||||
begin_status = this->udp_client_.beginPacketMulticast(broadcast, 9, interface_ip, 128);
|
||||
begin_status = this->udp_client_.beginPacketMulticast(broadcast, 9,
|
||||
IPAddress((ip_addr_t) esphome::network::get_ip_address()), 128);
|
||||
#endif
|
||||
#ifdef USE_ESP32
|
||||
begin_status = this->udp_client_.beginPacket(broadcast, 9);
|
||||
|
||||
Reference in New Issue
Block a user