From d3e47a5d8049ed8578327c918dab56dd38374457 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 11 Feb 2026 11:20:41 -0600 Subject: [PATCH] Fix encode_bool to encode actual value when force=true --- esphome/components/api/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 536a3536db5..9666b7e9ff3 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -292,7 +292,7 @@ class ProtoWriteBuffer { if (!value && !force) return; this->encode_field_raw(field_id, 0); // type 0: Varint - bool - this->buffer_->push_back(0x01); + this->buffer_->push_back(value ? 0x01 : 0x00); } void encode_fixed32(uint32_t field_id, uint32_t value, bool force = false) { if (value == 0 && !force)