Fix parameter types for pool select callbacks ()

This commit is contained in:
Chris Nussbaum 2022-06-06 21:41:13 -05:00 committed by GitHub
parent 1dfcb96301
commit 1e916230df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ PoolController::PoolController() {
this->pump_select_->set_name("Pool Pump Mode");
this->pump_select_->set_icon("mdi:pump");
this->pump_select_->traits.set_options({"Off", "Normal", "Always Except Peak", "Always"});
this->pump_select_->add_on_state_callback([this](std::string value, size_t index) -> void {
this->pump_select_->add_on_state_callback([this](const std::string &value, size_t index) {
this->pump_mode_ = static_cast<PumpMode>(index);
});
@ -38,7 +38,7 @@ PoolController::PoolController() {
this->cleaner_select_->set_name("Pool Cleaner Mode");
this->cleaner_select_->set_icon("mdi:robot-vacuum");
this->cleaner_select_->traits.set_options({"Off", "Normal", "When Pump Is On"});
this->cleaner_select_->add_on_state_callback([this](std::string value, size_t index) -> void {
this->cleaner_select_->add_on_state_callback([this](const std::string &value, size_t index) {
this->cleaner_mode_ = static_cast<CleanerMode>(index);
});