1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-26 04:28:17 +00:00
Fabian afc2b3b74f
Keep Device Class in Flash. ()
* Keep Device Class in Flash.

* Remove blank line

---------

Co-authored-by: Your Name <you@example.com>
2023-04-20 03:53:35 +00:00

18 lines
443 B
C++

#include "button.h"
#include "esphome/core/log.h"
namespace esphome {
namespace button {
static const char *const TAG = "button";
void Button::press() {
ESP_LOGD(TAG, "'%s' Pressed.", this->get_name().c_str());
this->press_action();
this->press_callback_.call();
}
void Button::add_on_press_callback(std::function<void()> &&callback) { this->press_callback_.add(std::move(callback)); }
} // namespace button
} // namespace esphome