Device { leds } parameter should work with any device type
Related to #626.
As requested, opening an issue here...
"leds" parameter in device section works only for apa102 leds. Ideally, it should work for any device type
why does it make sense? the count of leds are the count of configured leds in the leds block. I think we should remove this parameter from apa102 device.
I read the code, with that param you can say that there are more leds than configured. E.g. you have 50 leds in your leds section. When "leds" param of device section is lower 50, this value has no effect. Is it higher, the device is told that more leds are available. The reason for that is, when you have more leds than configured, then switch the unconfigured leds off. This solution isn't good, because this is not general enough. Better is, configure all leds and then implement a method to say that the led you want should be black/off. (the implement thing is not implemented yet, but shouldn't be hard)
Normally you can achieve this effect by defining these extra leds that you have, but you want them to be off - and assign special transformation to these leds with brightness=0. So currently it is possible but a bit cumbersome to do. "leds" parameter sounds like something convenient to achieve this effect.
Problem with "extra" leds being on is not only with apa102, but with ws2801 as well. I don't know what happens with ws2801 but it has been a problem with hyperion since I remember (at least for 3 years)
The effects engine needs to know how many LEDs it should be using - this is why we need the concept of maximum physical LEDs bs maximum configured/usable LEDs.
I agree that doing it the led devices is the wrong place.
Maybe the transform or even just before the call to updateleds is a much better place
While I agree that doing this in each led device code would be "suboptimal", however from config stand point "device" section does make sense as "leds" describes physical device (and not transformation)
Agreed - where it is configured doesn't have to align with where we implement it.
this should be done in hyperion class. today my day is a bit tight. tomorow evening I have time. I have a nice idea to solve this and other related issues. more later ....
I just remembered that the rpi_281x driver needs to know how many physical LEDs there are at startup time.
this issue is solved. see pr #77 for details