ESPHome
2024.11.3
esphome
esphome
components
tm1638
binary_sensor
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
tm1638_key.h
esphome::tm1638::TM1638Key::keys_update
void keys_update(uint8_t keys) override
Definition:
tm1638_key.cpp:6
esphome::binary_sensor::BinarySensor::state
bool state
The current reported state of the binary sensor.
Definition:
binary_sensor.h:61
esphome::binary_sensor::BinarySensor::publish_state
void publish_state(bool state)
Publish a new state to the front-end.
Definition:
binary_sensor.cpp:14
esphome::tm1638::TM1638Key::key_code_
uint8_t key_code_
Definition:
tm1638_key.h:15
esphome
Implementation of SPI Controller mode.
Definition:
a01nyub.cpp:7
Generated by
1.8.13