ESPHome-Devices/components/pool_controller/pool_select.h

27 lines
690 B
C
Raw Normal View History

2021-09-10 12:42:29 +00:00
#pragma once
#include "esphome/components/select/select.h"
#include "esphome/core/automation.h"
2021-09-10 12:42:29 +00:00
#include "esphome/core/component.h"
#include "esphome/core/preferences.h"
namespace esphome {
namespace pool_controller {
class PoolSelect : public select::Select, public Component {
public:
float get_setup_priority() const override { return setup_priority::HARDWARE; }
void setup() override;
void set_initial_option(const std::string &initial_option) { this->initial_option_ = initial_option; }
2021-09-10 12:42:29 +00:00
protected:
void control(const std::string &value) override;
std::string initial_option_;
2021-09-10 12:42:29 +00:00
ESPPreferenceObject pref_;
};
} // namespace pool_controller
} // namespace esphome