diff --git a/esphome/components/api/api_pb2.cpp b/esphome/components/api/api_pb2.cpp index e69654067b6..a4324b8db3f 100644 --- a/esphome/components/api/api_pb2.cpp +++ b/esphome/components/api/api_pb2.cpp @@ -1039,7 +1039,7 @@ bool HomeAssistantStateResponse::decode_length(uint32_t field_id, ProtoLengthDel bool DSTRule::decode_varint(uint32_t field_id, proto_varint_value_t value) { switch (field_id) { case 1: - this->time_seconds = decode_zigzag32(value); + this->time_seconds = decode_zigzag32(static_cast(value)); break; case 2: this->day = value; @@ -1064,10 +1064,10 @@ bool DSTRule::decode_varint(uint32_t field_id, proto_varint_value_t value) { bool ParsedTimezone::decode_varint(uint32_t field_id, proto_varint_value_t value) { switch (field_id) { case 1: - this->std_offset_seconds = decode_zigzag32(value); + this->std_offset_seconds = decode_zigzag32(static_cast(value)); break; case 2: - this->dst_offset_seconds = decode_zigzag32(value); + this->dst_offset_seconds = decode_zigzag32(static_cast(value)); break; default: return false; @@ -1147,13 +1147,13 @@ bool ExecuteServiceArgument::decode_varint(uint32_t field_id, proto_varint_value this->legacy_int = static_cast(value); break; case 5: - this->int_ = decode_zigzag32(value); + this->int_ = decode_zigzag32(static_cast(value)); break; case 6: this->bool_array.push_back(value != 0); break; case 7: - this->int_array.push_back(decode_zigzag32(value)); + this->int_array.push_back(decode_zigzag32(static_cast(value))); break; default: return false; diff --git a/script/api_protobuf/api_protobuf.py b/script/api_protobuf/api_protobuf.py index 1c2a3e5cc2f..b4044c362c6 100755 --- a/script/api_protobuf/api_protobuf.py +++ b/script/api_protobuf/api_protobuf.py @@ -1262,7 +1262,7 @@ class SFixed64Type(TypeInfo): class SInt32Type(TypeInfo): cpp_type = "int32_t" default_value = "0" - decode_varint = "decode_zigzag32(value)" + decode_varint = "decode_zigzag32(static_cast(value))" encode_func = "encode_sint32" wire_type = WireType.VARINT # Uses wire type 0