ESPHome 2025.5.0
Loading...
Searching...
No Matches
tt21100_button.cpp
Go to the documentation of this file.
1#include "tt21100_button.h"
2#include "esphome/core/log.h"
3
4namespace esphome {
5namespace tt21100 {
6
7static const char *const TAG = "tt21100.binary_sensor";
8
10 this->parent_->register_button_listener(this);
11 this->publish_initial_state(false);
12}
13
15 LOG_BINARY_SENSOR("", "TT21100 Button", this);
16 ESP_LOGCONFIG(TAG, " Index: %u", this->index_);
17}
18
19void TT21100Button::update_button(uint8_t index, uint16_t state) {
20 if (index != this->index_)
21 return;
22
23 this->publish_state(state > 0);
24}
25
26} // namespace tt21100
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, uint16_t state) override
bool state
Definition fan.h:0
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7