Add select

This commit is contained in:
T
2025-03-14 17:57:43 +01:00
parent 419143d70a
commit 6454dc6d58
6 changed files with 61 additions and 11 deletions

View File

@@ -36,6 +36,7 @@ class OptomaRS232Component : public uart::UARTDevice, public PollingComponent {
void loop() override;
float get_setup_priority() const override { return setup_priority::DATA; }
void update() override;
void beamer_input_select_changed(const std::string &, size_t);
// clang-format off
#ifndef USE_SENSOR
@@ -61,6 +62,8 @@ class OptomaRS232Component : public uart::UARTDevice, public PollingComponent {
SUB_SELECT(beamer_input)
protected:
Inputs current_input_{UNKNOWN};
void process_line_(const std::string &str);
void process_query_response_(const std::string &str);
bool waiting_for_command_response_ = false;
@@ -71,5 +74,12 @@ class OptomaRS232Component : public uart::UARTDevice, public PollingComponent {
size_t cursor_ = 0;
};
#ifdef USE_SELECT
class InputSelect : public select::Select, public Parented<OptomaRS232Component> {
protected:
void control(const std::string &value) override;
};
#endif
} // namespace optoma_rs232
} // namespace esphome