From a323d4f8488eccfc80dd5d97e16d6b573c8cfca2 Mon Sep 17 00:00:00 2001 From: Jarl Nicolson Date: Fri, 20 May 2022 22:30:29 +1000 Subject: [PATCH] Add index parameter into callback function for select state change --- components/panasonic_ac/esppac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/panasonic_ac/esppac.cpp b/components/panasonic_ac/esppac.cpp index fd0f6c5..3458a32 100644 --- a/components/panasonic_ac/esppac.cpp +++ b/components/panasonic_ac/esppac.cpp @@ -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); @@ -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);