mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-25 23:28:28 +02:00
Add TT21100 touchscreen component (#4793)
Co-authored-by: Rajan Patel <rpatel3001@gmail.com> Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#include "tt21100_button.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace tt21100 {
|
||||
|
||||
static const char *const TAG = "tt21100.binary_sensor";
|
||||
|
||||
void TT21100Button::setup() {
|
||||
this->parent_->register_button_listener(this);
|
||||
this->publish_initial_state(false);
|
||||
}
|
||||
|
||||
void TT21100Button::dump_config() {
|
||||
LOG_BINARY_SENSOR("", "TT21100 Button", this);
|
||||
ESP_LOGCONFIG(TAG, " Index: %u", this->index_);
|
||||
}
|
||||
|
||||
void TT21100Button::update_button(uint8_t index, uint16_t state) {
|
||||
if (index != this->index_)
|
||||
return;
|
||||
|
||||
this->publish_state(state > 0);
|
||||
}
|
||||
|
||||
} // namespace tt21100
|
||||
} // namespace esphome
|
||||
Reference in New Issue
Block a user