Use esphome device as interface to program an arduino OTA

Is it possible to upload a new sketch to an Arduino using an ESP device as the transport mechanism ?.
Case, I have a solar dump device that is Arduino based.
I have connected an ESPhome device to its serial interface and I can read data sent from the Arduino. The next step for me would be to update the sketch using the same ESPhome device.
Anyone tried this ?