[noob] Will this code and product work?

I code in SQL and python for work, and I am not knowledgeable in embedded C++ for ESP home. This is my first esp home and home assistant setup. The factory firmware of the particular product I am trying to flash works with software (meaning HA) and with physical mechanical switches. I would like to know if the code in the link can replicate the factory firmware?

The factory firmware works with software and with physical mechanical switches as a 2 way switch.

Product Link: Tinxy 4N with Fan Regulator | devices.esphome.io
Product demo with factory firmware: https://www.youtube.com/watch?v=C5O4Oi-0fdA&t=424s

Before you flash the board, backup the firmware that’s currently on it. If things don’t work as expected, revert to the original firmware.

From a cursory look at the esphome devices link, I am assuming it should work as you expect.