Skip to content

Commit

Permalink
Merge pull request #59 from jnicolson/master
Browse files Browse the repository at this point in the history
Add index parameter into callback function for select state change
  • Loading branch information
DomiStyle authored May 21, 2022
2 parents 60ca203 + a323d4f commit 3821e9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/panasonic_ac/esppac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void PanasonicAC::set_current_temperature_sensor(sensor::Sensor *current_tempera

void PanasonicAC::set_vertical_swing_select(select::Select *vertical_swing_select) {
this->vertical_swing_select_ = vertical_swing_select;
this->vertical_swing_select_->add_on_state_callback([this](const std::string &value) {
this->vertical_swing_select_->add_on_state_callback([this](const std::string &value, size_t index) {
if (value == this->vertical_swing_state_)
return;
this->on_vertical_swing_change(value);
Expand All @@ -189,7 +189,7 @@ void PanasonicAC::set_vertical_swing_select(select::Select *vertical_swing_selec

void PanasonicAC::set_horizontal_swing_select(select::Select *horizontal_swing_select) {
this->horizontal_swing_select_ = horizontal_swing_select;
this->horizontal_swing_select_->add_on_state_callback([this](const std::string &value) {
this->horizontal_swing_select_->add_on_state_callback([this](const std::string &value, size_t index) {
if (value == this->horizontal_swing_state_)
return;
this->on_horizontal_swing_change(value);
Expand Down

0 comments on commit 3821e9f

Please sign in to comment.