mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-06 21:09:53 +02:00
Add Tuya select (#3469)
This commit is contained in:
committed by
GitHub
parent
0665acd190
commit
f62d5d3b9d
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/components/tuya/tuya.h"
|
||||
#include "esphome/components/select/select.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace tuya {
|
||||
|
||||
class TuyaSelect : public select::Select, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
void set_tuya_parent(Tuya *parent) { this->parent_ = parent; }
|
||||
void set_optimistic(bool optimistic) { this->optimistic_ = optimistic; }
|
||||
void set_select_id(uint8_t select_id) { this->select_id_ = select_id; }
|
||||
void set_select_mappings(std::vector<uint8_t> mappings) { this->mappings_ = std::move(mappings); }
|
||||
|
||||
protected:
|
||||
void control(const std::string &value) override;
|
||||
|
||||
Tuya *parent_;
|
||||
bool optimistic_ = false;
|
||||
uint8_t select_id_;
|
||||
std::vector<uint8_t> mappings_;
|
||||
};
|
||||
|
||||
} // namespace tuya
|
||||
} // namespace esphome
|
||||
Reference in New Issue
Block a user