For 15-inch MacBook Pro users with Photoshop installed, don’t let this bug kill your battery life.
My 15-inch MacBook Pro was randomly getting hot and losing battery life like crazy. Eventually I found that whenever I used Spotlight, it would occasionally trigger the dGPU and would NOT turn itself off afterwards.
After doing some digging I discovered that Spotlight would sometimes run into a file in the Photoshop application folder that caused it to bug out. I solved this by going into Settings > Spotlight, and in the Privacy tab, blocking Spotlight from searching the Presets folder in the Photoshop app.
Problem solved and now my computer runs cool most of the time and only triggers the dGPU when it actually needs it.