Since you hooked it up to Home Assistant anyway, I think you could have skipped the custom firmware and just used ESPHome with a Button component https://esphome.io/components/button/
I’ve got a vibe coded “Nuaire Fan” controller to talk UART to my whole home ventilation and present it as a HA controllable fan.
I couldn't believe it when it basically worked on the first try, including pairing with the base unit and other remotes.