I'm pretty sure all those Bafang units, like the Tongsheng ones, have a lighting circuit in the loom as standard.
On the Tongsheng, you can get a replacement speed sensor cable that tees off the lighting pins to conveniently connect to them; the Bafang may be similar.