So, sadly there is no direct way to do that, I believe. At this time, but I believe Ben could add something to help here.
If you limit the settings in power to 80%, then 100% of the LEDs can reach 80%, with the brightness control turned up to maximum.
Since PB doesn’t have an accessible array/etc, you don’t get a chance to see the overall pixels before it’s actually render by the render loop, if you use hsv()
or rgb()
. You could build your own version of these, or, like the pseudo-buffer approach we’ve used in a bunch of patterns, shove the data into an array, process it to adjust for power consumption, and then push the (now limited power-wise) buffer data out to actually be rendered.
If there was a “post render” function, that had the ready to go data, [so we’ve looped thru the render loop, but before the data is sent to the LEDs], you could do your power management there. Since there isn’t, you essentially need to do it during the render loop, which doesn’t give you the total picture, just one pixel at a time. You could do a running total, and “choke back” on the power once the running total is too high, or if the current pixel’s too bright relative to what the average is, etc.
You can also hide the settings, if this is a user issue and you want to limit it from casual users. But that is limited to overall percentage of brightness, not by power consumption.
WLED has this feature, you can set a power threshold in milliamps, and it’ll keep the overall levels below that. PB doesn’t have this option. That might be worth @wizard considering adding, since it’s a very useful limiter. “I only have a 8a power supply on this, don’t let my pixels exceed 7.5 amps”. It’s difficult to do this with PB now, and someone loading a bright downloaded or altered pattern could easily cause hardware issues pushing past power limits.