Controlling ESP32 from home assistant

Hi,
I wrote my arduino code on my computer and uploaded it to ESP32 using the IDE and usb cable. Now my ESP32 is working as it’s supposed to, I would like to know how I can add it to home assistant. (it’s already connected to my wifi).
My understanding is using ESPHome works only if you want to push the yaml file from ESPHome to your ESP32 which would delete all my code on ESP32.
I am sure it’s something possible, just can’t find it anywhere.
Thanks.,

The only way I know to do it is to use mqtt.

Did you check whether it’s possible to do what you did using ESPHome? If you use that, it’s pretty easy to integrate it.

Yep, that did the trick.
Thank you so much for this simple solution. I was going to more complicated stuff LOL