#pragma once #include #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 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 sources = { {"30", "HDMI1"}, {"53", "LAN"}, {"A0", "HDMI2"} }; std::map luminance = { {"00", "Normal"}, {"01", "Eco"}, {"02", "Medium"} }; protected: void control(const std::string &value) override; std::string cmd_; tw7100Component *parent_; }; } // namespace tw7100 } // namespace esphome