Sonoff tx t3 ESPHome (help)

Looking as ESPHome have changed its code I cant update some older switches, but I seen a new Code on the ESP website but it puts the relays in with the buttons, wondering has anyone got a working code where the relays are separate from the buttons?