Create GT911 Touchscreen component (#4027)
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
1 parent
a15a812466
commit
f63f722afb
11 files changed
+314
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#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
|
||||
Reference in new issue
Block a user