ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
wake_on_lan.h
Go to the documentation of this file.
1#pragma once
3#if defined(USE_NETWORK) && !defined(USE_ZEPHYR)
6#if defined(USE_SOCKET_IMPL_BSD_SOCKETS) || defined(USE_SOCKET_IMPL_LWIP_SOCKETS)
8#else
9#include "WiFiUdp.h"
10#endif
11
12namespace esphome::wake_on_lan {
13
15 public:
16 void set_macaddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f);
17
18 void dump_config() override;
19 void setup() override;
20 float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
21
22 protected:
23#if defined(USE_SOCKET_IMPL_BSD_SOCKETS) || defined(USE_SOCKET_IMPL_LWIP_SOCKETS)
24 std::unique_ptr<socket::Socket> broadcast_socket_{};
25#else
26 WiFiUDP udp_client_{};
27#endif
28 void press_action() override;
29 uint16_t port_{9};
30 uint8_t macaddr_[6];
31};
32
33} // namespace esphome::wake_on_lan
34
35#endif // USE_NETWORK && !USE_ZEPHYR
ESPDEPRECATED("set_retry is deprecated and will be removed in 2026.8.0. Use set_timeout or set_interval instead.", "2026.2.0") void set_retry(const std uint32_t uint8_t std::function< RetryResult(uint8_t)> && f
Definition component.h:437
Base class for all buttons.
Definition button.h:25
void set_macaddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f)
float get_setup_priority() const override
Definition wake_on_lan.h:20
std::unique_ptr< socket::Socket > broadcast_socket_
Definition wake_on_lan.h:24
constexpr float AFTER_WIFI
For components that should be initialized after WiFi is connected.
Definition component.h:53