mirror of
https://github.com/esphome/esphome.git
synced 2025-09-04 20:32:21 +01:00
[api] Fix VERY_VERBOSE logging compilation error with bool arrays (#10539)
This commit is contained in:
@@ -1135,7 +1135,7 @@ void ExecuteServiceArgument::dump_to(std::string &out) const {
|
||||
dump_field(out, "string_", this->string_);
|
||||
dump_field(out, "int_", this->int_);
|
||||
for (const auto it : this->bool_array) {
|
||||
dump_field(out, "bool_array", it, 4);
|
||||
dump_field(out, "bool_array", static_cast<bool>(it), 4);
|
||||
}
|
||||
for (const auto &it : this->int_array) {
|
||||
dump_field(out, "int_array", it, 4);
|
||||
|
@@ -1059,7 +1059,9 @@ def _generate_array_dump_content(
|
||||
# Check if underlying type can use dump_field
|
||||
if ti.can_use_dump_field():
|
||||
# For types that have dump_field overloads, use them with extra indent
|
||||
o += f' dump_field(out, "{name}", {ti.dump_field_value("it")}, 4);\n'
|
||||
# std::vector<bool> iterators return proxy objects, need explicit cast
|
||||
value_expr = "static_cast<bool>(it)" if is_bool else ti.dump_field_value("it")
|
||||
o += f' dump_field(out, "{name}", {value_expr}, 4);\n'
|
||||
else:
|
||||
# For complex types (messages, bytes), use the old pattern
|
||||
o += f' out.append(" {name}: ");\n'
|
||||
|
@@ -4,7 +4,7 @@ esphome:
|
||||
host:
|
||||
|
||||
logger:
|
||||
level: DEBUG
|
||||
level: VERY_VERBOSE
|
||||
|
||||
api:
|
||||
actions:
|
||||
|
Reference in New Issue
Block a user