This is a neat little module that I just ordered. https://www.aliexpress.us/item/3256804112798600.html

Hooks into bafang BBS* display wiring to pull proper power for head/tail lights, but also use the existing crappy 6V/.5A headlight wire to allow turning lights on/off via bafang display.

I'm gonna see if I can wire up my existing older dynamo headlight (B&M Luxos B). I also have a B&M toplight rear light, but I'm guessing I'd be better off with a general ebike rear light w/ separate brake light wire. #BikeNerdStuff

1 Set Bafang Mid-mounted Motor Modification Kit 6V Light Group Adapter Cable Brake Light Bike Replacement Cable Part Accessories - AliExpress 18

Smarter Shopping, Better Living! Aliexpress.com

aliexpress.
On my other bafang ebike, I'll stick with the front dynamo hub & lights. There's no 6V/.5A wire from the controller on that one anyways.