#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; } protected: std::map sources = { {"HDMI1", 0x30}, {"LAN", 0x53}, {"HDMI2", 0xA0} }; void control(const std::string &value) override; std::string cmd_; tw7100Component *parent_; }; } // namespace tw7100 } // namespace esphome