mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 12:43:28 +02:00
f63f722afb
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
28 lines
586 B
C++
28 lines
586 B
C++
#include "gt911_button.h"
|
|
#include "esphome/core/log.h"
|
|
|
|
namespace esphome {
|
|
namespace gt911 {
|
|
|
|
static const char *const TAG = "GT911.binary_sensor";
|
|
|
|
void GT911Button::setup() {
|
|
this->parent_->register_button_listener(this);
|
|
this->publish_initial_state(false);
|
|
}
|
|
|
|
void GT911Button::dump_config() {
|
|
LOG_BINARY_SENSOR("", "GT911 Button", this);
|
|
ESP_LOGCONFIG(TAG, " Index: %u", this->index_);
|
|
}
|
|
|
|
void GT911Button::update_button(uint8_t index, bool state) {
|
|
if (index != this->index_)
|
|
return;
|
|
|
|
this->publish_state(state);
|
|
}
|
|
|
|
} // namespace gt911
|
|
} // namespace esphome
|