ESPHome  2024.11.3
custom_switch.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #include <vector>
7 
8 namespace esphome {
9 namespace custom {
10 
12  public:
13  CustomSwitchConstructor(const std::function<std::vector<switch_::Switch *>()> &init) { this->switches_ = init(); }
14 
15  switch_::Switch *get_switch(int i) { return this->switches_[i]; }
16 
17  void dump_config() override;
18 
19  protected:
20  std::vector<switch_::Switch *> switches_;
21 };
22 
23 } // namespace custom
24 } // namespace esphome
Base class for all switches.
Definition: switch.h:39
std::vector< switch_::Switch * > switches_
Definition: custom_switch.h:20
switch_::Switch * get_switch(int i)
Definition: custom_switch.h:15
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void init()
Definition: core.cpp:80
CustomSwitchConstructor(const std::function< std::vector< switch_::Switch *>()> &init)
Definition: custom_switch.h:13