ESPHome  2024.10.2
tuya_select.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 #include <vector>
8 
9 namespace esphome {
10 namespace tuya {
11 
12 class TuyaSelect : public select::Select, public Component {
13  public:
14  void setup() override;
15  void dump_config() override;
16 
17  void set_tuya_parent(Tuya *parent) { this->parent_ = parent; }
18  void set_optimistic(bool optimistic) { this->optimistic_ = optimistic; }
19  void set_select_id(uint8_t select_id) { this->select_id_ = select_id; }
20  void set_select_mappings(std::vector<uint8_t> mappings) { this->mappings_ = std::move(mappings); }
21 
22  protected:
23  void control(const std::string &value) override;
24 
26  bool optimistic_ = false;
27  uint8_t select_id_;
28  std::vector<uint8_t> mappings_;
29 };
30 
31 } // namespace tuya
32 } // namespace esphome
void dump_config() override
Definition: tuya_select.cpp:41
void set_select_mappings(std::vector< uint8_t > mappings)
Definition: tuya_select.h:20
void control(const std::string &value) override
Definition: tuya_select.cpp:26
std::vector< uint8_t > mappings_
Definition: tuya_select.h:28
void set_tuya_parent(Tuya *parent)
Definition: tuya_select.h:17
void setup() override
Definition: tuya_select.cpp:9
void set_optimistic(bool optimistic)
Definition: tuya_select.h:18
Base-class for all selects.
Definition: select.h:31
void set_select_id(uint8_t select_id)
Definition: tuya_select.h:19
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7