ESPHome 2025.5.0
Loading...
Searching...
No Matches
tuya_select.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <vector>
8
9namespace esphome {
10namespace tuya {
11
12class 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, bool is_int) {
20 this->select_id_ = select_id;
21 this->is_int_ = is_int;
22 }
23 void set_select_mappings(std::vector<uint8_t> mappings) { this->mappings_ = std::move(mappings); }
24
25 protected:
26 void control(const std::string &value) override;
27
29 bool optimistic_ = false;
30 uint8_t select_id_;
31 std::vector<uint8_t> mappings_;
32 bool is_int_ = false;
33};
34
35} // namespace tuya
36} // namespace esphome
Base-class for all selects.
Definition select.h:31
void set_select_id(uint8_t select_id, bool is_int)
Definition tuya_select.h:19
void dump_config() override
void control(const std::string &value) override
void set_optimistic(bool optimistic)
Definition tuya_select.h:18
void set_select_mappings(std::vector< uint8_t > mappings)
Definition tuya_select.h:23
std::vector< uint8_t > mappings_
Definition tuya_select.h:31
void set_tuya_parent(Tuya *parent)
Definition tuya_select.h:17
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7