The T centre is a silicon colour centre which hosts long-lived spins and a spin-photon interface with emission in the telecommunications O-band, making it a promising platform for quantum technologies. We integrate T centres with silicon nanophotonic devices and p-i-n diodes for electrical excitation, observing electroluminescence from both ensembles and single T centres—an electrically-injected single-photon source. Using electrical excitation, we demonstrate a new method of spin initialization by heralding on the emission energy, enabling a parallelizable control scheme for networked devices.