Ming, glad it arrived safely.
My order of D2flex has just shipped, so I should be able to get some lights built up next week. I'll post a tutorial to help with the builds.
The D2flex is the upgrade to the old D2DIM. In reviewing the
D2flex operating manual I found it now incorporates the fixed, portable, and bike lighting UIs, as well as a thermal protection option.
There are 2 suitable mounting locations for the board in the light: on the end of the stock switch, or on the back of the heatsink. By mounting it to the sink with an appropriate path or thermal epoxy, the thermal protection should work to monitor the temp and guard against thermal runaway.
Mounting it to the back of the sink poses one difficulty - wire twist during assembly. I'll outline an assembly method to minimize twist, but basically it is to thread the head all the way down the tube as far as it will go. Hopefully the tube is near the top of the threads inside the head. Connect the board/sink/LED module to the switch and power leads. Place the sink down in the head onto the end of the tube. There should be little gap between the botom of the sink and the end of the tube. Holding the tube and sink stationary, unthread the head. As the head rises it will engage the sink threads, and the small gap between the sink and tube will remain constant as the head is further unscrewed. Keep unscrewing the head until it rises and meets the sink, then tighthen them together. Finally tighten the sink/head back down onto the tube until the sink and tube butt. Theoretically this will give a max twist of one revolution. Practice it first and see, then you can pre-twist the wires before assembly.
One problem that might arise is that the head does not thread down the tube all the way. I've found that some heads don't even thread on at all. The tube/head threads might require some polishing or light sanding to enable this method. The head needs to thread all the way down for this to work.
If this method won't work for you, you can try simply counting the revolutions it takes to tighten the head, and pre-twist the wires before assembly, or try simultaneously spinning the switch in the tube with the head as it is threaded down the tube.
If you mount the board onto the end of the switch (the switch tower can be shaped to hold the board), you won't have to deal with wire twist. Just pass the leads up through the sink, then assemble the head/sink to the tube. The loose leads are free to spin as you thread the head/sink onto the tube. Solder the leads to the LEDs after the head/sink/tube are tight. Of course this location of the board will not be able to use the thermal protection feature.
Another thing to note is that the P7s sometimes have little metal barbs sticking out the sides of the plastic surround. These need to be trimmed or filed flush or they will hang up on the machined pocket of the sink. Better to do it before than after the epoxy is mixed.