esphome/esphome/components/wake_on_lan/wake_on_lan.h
William Charlton f0b183a552
Wake-on-LAN button (#3030)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: William Charlton <will.charlton1@icloud.com>
2022-01-23 00:13:46 +13:00

27 lines
533 B
C++

#pragma once
#ifdef USE_ARDUINO
#include "esphome/components/button/button.h"
#include "esphome/core/component.h"
#include "WiFiUdp.h"
namespace esphome {
namespace wake_on_lan {
class WakeOnLanButton : public button::Button, public Component {
public:
void set_macaddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f);
void dump_config() override;
protected:
WiFiUDP udp_client_{};
void press_action() override;
uint8_t macaddr_[6];
};
} // namespace wake_on_lan
} // namespace esphome
#endif