101 lines
2.4 KiB
C++
101 lines
2.4 KiB
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_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"}
|
|
};
|
|
std::map<std::string, std::string> aspect = {
|
|
{"00", "Normal"},
|
|
{"30", "Auto"},
|
|
{"40", "Full"},
|
|
{"50", "Zoom"},
|
|
{"80", "Anamorphic"},
|
|
{"90", "Hsqueeze"}
|
|
};
|
|
std::map<std::string, std::string> msel = {
|
|
{"00", "Black"},
|
|
{"01", "Blue"},
|
|
{"02", "User logo"}
|
|
};
|
|
std::map<std::string, std::string> speed = {
|
|
{"00", "9600bps"},
|
|
{"01", "19200bps"},
|
|
{"02", "38400bps"},
|
|
{"03", "57600bps"}
|
|
};
|
|
std::map<std::string, std::string> mcfi = {
|
|
{"00", "Off"},
|
|
{"01", "Low"},
|
|
{"02", "Normal"},
|
|
{"03", "High"}
|
|
};
|
|
std::map<std::string, std::string> clrspace = {
|
|
{"00", "Auto"},
|
|
{"01", "BT.709"},
|
|
{"02", "BT.2020"}
|
|
};
|
|
std::map<std::string, std::string> dynrange = {
|
|
{"00", "Auto"},
|
|
{"01", "SDR"},
|
|
{"20", "HDR10"},
|
|
{"30", "HLG"}
|
|
};
|
|
std::map<std::string, std::string> imgpreset = {
|
|
{"00", "Off"},
|
|
{"01", "Setting 1"},
|
|
{"02", "Setting 2"},
|
|
{"03", "Setting 3"},
|
|
{"04", "Setting 4"},
|
|
{"05", "Setting 5"}
|
|
};
|
|
std::map<std::string, std::string> gamma = {
|
|
{"20", "Setting 2"},
|
|
{"21", "Setting 1"},
|
|
{"22", "Setting 0"},
|
|
{"23", "Setting -1"},
|
|
{"24", "Setting -2"},
|
|
{"F0", "Custom"}
|
|
};
|
|
std::map<std::string, std::string> cmode = {
|
|
{"06", "Dynamic"},
|
|
{"07", "Natural"},
|
|
{"0C", "Bright Cinema"},
|
|
{"15", "Cinema"}
|
|
};
|
|
std::map<std::string, std::string> ovscan = {
|
|
{"00", "Off"},
|
|
{"02", "4%"},
|
|
{"04", "8%"},
|
|
{"A0", "Auto"}
|
|
};
|
|
|
|
protected:
|
|
void control(const std::string &value) override;
|
|
std::string cmd_;
|
|
tw7100Component *parent_;
|
|
};
|
|
|
|
} // namespace tw7100
|
|
} // namespace esphome
|