1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 04:12:23 +01:00

[api] Fix VERY_VERBOSE logging compilation error with bool arrays (#10539)

This commit is contained in:
J. Nick Koston
2025-09-03 15:07:13 -05:00
committed by GitHub
parent 5759692627
commit 23c6650902
3 changed files with 5 additions and 3 deletions

View File

@@ -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);

View File

@@ -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'

View File

@@ -4,7 +4,7 @@ esphome:
host:
logger:
level: DEBUG
level: VERY_VERBOSE
api:
actions: