esphome-tw7100/select/tw7100_select.h
2024-09-17 00:58:39 +02:00

38 lines
961 B
C++

#pragma once
#include <map>
#include "esphome/core/component.h"
#include "esphome/components/select/select.h"
namespace esphome {
namespace tw7100 {
class tw7100Component;
class tw7100Select : public select::Select, public Component {
public:
void setup() override;
void dump_config() override;
void set_options(std::vector<std::string> options) { this->traits.set_options(options); }
void set_tw7100_parent(tw7100Component *parent) { this->parent_ = parent; }
void set_cmd(std::string cmd) { this->cmd_ = cmd; }
std::map<std::string, std::string> sources = {
{"30", "HDMI1"},
{"53", "LAN"},
{"A0", "HDMI2"}
};
std::map<std::string, std::string> luminance = {
{"00", "Normal"},
{"01", "Eco"},
{"02", "Medium"}
};
protected:
void control(const std::string &value) override;
std::string cmd_;
tw7100Component *parent_;
};
} // namespace tw7100
} // namespace esphome