ESPHome  2024.3.1
tm1638_key.cpp
Go to the documentation of this file.
1 #include "tm1638_key.h"
2 
3 namespace esphome {
4 namespace tm1638 {
5 
6 void TM1638Key::keys_update(uint8_t keys) {
7  bool pressed = keys & (1 << key_code_);
8  if (pressed != this->state)
9  this->publish_state(pressed);
10 }
11 
12 } // namespace tm1638
13 } // namespace esphome
void keys_update(uint8_t keys) override
Definition: tm1638_key.cpp:6
bool state
The current reported state of the binary sensor.
Definition: binary_sensor.h:61
void publish_state(bool state)
Publish a new state to the front-end.
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7