diff --git a/select/tw7100_select.cpp b/select/tw7100_select.cpp index 49413e2..b07d8ea 100644 --- a/select/tw7100_select.cpp +++ b/select/tw7100_select.cpp @@ -7,6 +7,81 @@ namespace esphome { namespace tw7100 { +std::map tw7100Select::sources = { + {"30", "HDMI1"}, + {"53", "LAN"}, + {"A0", "HDMI2"} +}; +std::map tw7100Select::luminance = { + {"00", "Normal"}, + {"01", "Eco"}, + {"02", "Medium"} +}; +std::map tw7100Select::aspect = { + {"00", "Normal"}, + {"30", "Auto"}, + {"40", "Full"}, + {"50", "Zoom"}, + {"80", "Anamorphic"}, + {"90", "Hsqueeze"} +}; +std::map tw7100Select::msel = { + {"00", "Black"}, + {"01", "Blue"}, + {"02", "User logo"} +}; +std::map tw7100Select::speed = { + {"00", "9600bps"}, + {"01", "19200bps"}, + {"02", "38400bps"}, + {"03", "57600bps"} +}; +std::map tw7100Select::mcfi = { + {"00", "Off"}, + {"01", "Low"}, + {"02", "Normal"}, + {"03", "High"} +}; +std::map tw7100Select::clrspace = { + {"00", "Auto"}, + {"01", "BT.709"}, + {"02", "BT.2020"} +}; +std::map tw7100Select::dynrange = { + {"00", "Auto"}, + {"01", "SDR"}, + {"20", "HDR10"}, + {"30", "HLG"} +}; +std::map tw7100Select::imgpreset = { + {"00", "Off"}, + {"01", "Setting 1"}, + {"02", "Setting 2"}, + {"03", "Setting 3"}, + {"04", "Setting 4"}, + {"05", "Setting 5"} +}; +std::map tw7100Select::gamma = { + {"20", "Setting 2"}, + {"21", "Setting 1"}, + {"22", "Setting 0"}, + {"23", "Setting -1"}, + {"24", "Setting -2"}, + {"F0", "Custom"} +}; +std::map tw7100Select::cmode = { + {"06", "Dynamic"}, + {"07", "Natural"}, + {"0C", "Bright Cinema"}, + {"15", "Cinema"} +}; +std::map tw7100Select::ovscan = { + {"00", "Off"}, + {"02", "4%"}, + {"04", "8%"}, + {"A0", "Auto"} +}; + std::vector get_map_keys(std::map map_) { std::vector map_keys; for (auto element : map_) { map_keys.push_back(element.first); } diff --git a/select/tw7100_select.h b/select/tw7100_select.h index 80e2fbd..4638f40 100644 --- a/select/tw7100_select.h +++ b/select/tw7100_select.h @@ -15,80 +15,18 @@ class tw7100Select : public select::Select, public Component { void dump_config() override; 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"} - }; - std::map aspect = { - {"00", "Normal"}, - {"30", "Auto"}, - {"40", "Full"}, - {"50", "Zoom"}, - {"80", "Anamorphic"}, - {"90", "Hsqueeze"} - }; - std::map msel = { - {"00", "Black"}, - {"01", "Blue"}, - {"02", "User logo"} - }; - std::map speed = { - {"00", "9600bps"}, - {"01", "19200bps"}, - {"02", "38400bps"}, - {"03", "57600bps"} - }; - std::map mcfi = { - {"00", "Off"}, - {"01", "Low"}, - {"02", "Normal"}, - {"03", "High"} - }; - std::map clrspace = { - {"00", "Auto"}, - {"01", "BT.709"}, - {"02", "BT.2020"} - }; - std::map dynrange = { - {"00", "Auto"}, - {"01", "SDR"}, - {"20", "HDR10"}, - {"30", "HLG"} - }; - std::map imgpreset = { - {"00", "Off"}, - {"01", "Setting 1"}, - {"02", "Setting 2"}, - {"03", "Setting 3"}, - {"04", "Setting 4"}, - {"05", "Setting 5"} - }; - std::map gamma = { - {"20", "Setting 2"}, - {"21", "Setting 1"}, - {"22", "Setting 0"}, - {"23", "Setting -1"}, - {"24", "Setting -2"}, - {"F0", "Custom"} - }; - std::map cmode = { - {"06", "Dynamic"}, - {"07", "Natural"}, - {"0C", "Bright Cinema"}, - {"15", "Cinema"} - }; - std::map ovscan = { - {"00", "Off"}, - {"02", "4%"}, - {"04", "8%"}, - {"A0", "Auto"} - }; + static std::map sources; + static std::map luminance; + static std::map aspect; + static std::map msel; + static std::map speed; + static std::map mcfi; + static std::map clrspace; + static std::map dynrange; + static std::map imgpreset; + static std::map gamma; + static std::map cmode; + static std::map ovscan; protected: void control(const std::string &value) override;