ESPHome  2024.10.2
tm1638_switch_led.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include "../tm1638.h"
6 
7 namespace esphome {
8 namespace tm1638 {
9 
10 class TM1638SwitchLed : public switch_::Switch, public Component {
11  public:
12  void dump_config() override;
13 
14  void set_tm1638(TM1638Component *tm1638) { tm1638_ = tm1638; }
15  void set_lednum(int led) { led_ = led; }
16 
17  protected:
18  void write_state(bool state) override;
20  int led_;
21 };
22 } // namespace tm1638
23 } // namespace esphome
Base class for all switches.
Definition: switch.h:39
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void set_tm1638(TM1638Component *tm1638)
bool state
The current reported state of the binary sensor.
Definition: switch.h:53
void write_state(bool state) override