mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 15:38:11 +01:00
online_image: replace c++17 syntax
This commit is contained in:
parent
dad61299b8
commit
7365f5e219
1 changed files with 6 additions and 4 deletions
|
@ -104,10 +104,12 @@ void OnlineImage::update() {
|
|||
}
|
||||
|
||||
std::list<http_request::Header> headers;
|
||||
for (const auto &[key, value_template] : this->headers_) {
|
||||
auto val = value_template();
|
||||
if (val.has_value()) {
|
||||
headers.push_back(http_request::Header{key, *val});
|
||||
for (const auto &item : this->headers_) {
|
||||
auto header_name = item.first;
|
||||
auto header_value_template = item.second;
|
||||
auto header_value = header_value_template();
|
||||
if (header_value.has_value()) {
|
||||
headers.push_back(http_request::Header{header_name, *header_value});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue