Add select
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user