mirror of
https://github.com/esphome/esphome.git
synced 2025-11-16 14:55:50 +00:00
Merge branch 'integration' into memory_api
This commit is contained in:
@@ -117,10 +117,10 @@ void SelectCall::perform() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto idx = target_index.value();
|
||||||
// All operations use indices, call control() by index to avoid string conversion
|
// All operations use indices, call control() by index to avoid string conversion
|
||||||
const auto &options = parent->traits.get_options();
|
ESP_LOGD(TAG, "'%s' - Set selected option to: %s", name, parent->option_at(idx));
|
||||||
ESP_LOGD(TAG, "'%s' - Set selected option to: %s", name, options[target_index.value()]);
|
parent->control(idx);
|
||||||
parent->control(target_index.value());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace select
|
} // namespace select
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class SelectCall {
|
|||||||
SelectCall &with_index(size_t index);
|
SelectCall &with_index(size_t index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
optional<size_t> calculate_target_index_(const char *name);
|
__attribute__((always_inline)) inline optional<size_t> calculate_target_index_(const char *name);
|
||||||
|
|
||||||
Select *const parent_;
|
Select *const parent_;
|
||||||
optional<size_t> index_;
|
optional<size_t> index_;
|
||||||
|
|||||||
Reference in New Issue
Block a user