Files
esphome/esphome/components/tm1638/binary_sensor/tm1638_key.cpp
2022-09-12 08:30:15 -07:00

14 lines
265 B
C++

#include "tm1638_key.h"
namespace esphome {
namespace tm1638 {
void TM1638Key::keys_update(uint8_t keys) {
bool pressed = keys & (1 << key_code_);
if (pressed != this->state)
this->publish_state(pressed);
}
} // namespace tm1638
} // namespace esphome