ESPHome 2025.5.0
Loading...
Searching...
No Matches
gt911_button.cpp
Go to the documentation of this file.
1#include "gt911_button.h"
2#include "esphome/core/log.h"
3
4namespace esphome {
5namespace gt911 {
6
7static const char *const TAG = "GT911.binary_sensor";
8
10 this->parent_->register_button_listener(this);
11 this->publish_initial_state(false);
12}
13
15 LOG_BINARY_SENSOR("", "GT911 Button", this);
16 ESP_LOGCONFIG(TAG, " Index: %u", this->index_);
17}
18
19void GT911Button::update_button(uint8_t index, bool state) {
20 if (index != this->index_)
21 return;
22
23 this->publish_state(state);
24}
25
26} // namespace gt911
27} // namespace esphome
void publish_initial_state(bool state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
void publish_state(bool state)
Publish a new state to the front-end.
void update_button(uint8_t index, bool state) override
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7