Add support for TM1638 Led and Key component (#3340)

This commit is contained in:
Jordan W. Cobb
2022-09-12 11:30:15 -04:00
committed by GitHub
parent 9ff187c3f8
commit cbd8d70431
17 changed files with 855 additions and 0 deletions
@@ -0,0 +1,20 @@
#include "tm1638_switch_led.h"
#include "esphome/core/log.h"
namespace esphome {
namespace tm1638 {
static const char *const TAG = "tm1638.led";
void TM1638SwitchLed::write_state(bool state) {
tm1638_->set_led(led_, state);
publish_state(state);
}
void TM1638SwitchLed::dump_config() {
LOG_SWITCH("", "TM1638 LED", this);
ESP_LOGCONFIG(TAG, " LED: %d", led_);
}
} // namespace tm1638
} // namespace esphome