mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 11:56:25 +01:00
online_image: replace c++17 syntax
This commit is contained in:
parent
dad61299b8
commit
7365f5e219
@ -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 New Issue
Block a user