Closed paulwrath1223 closed 10 months ago
Ok, so after digging through the source, the capability returned by the API call is actually a different structure than the bus light capabilities. Not only that, but it actually returns the sum of all capabilities shared by all buses, so even if the segment is on a single channel strip, if the WLED has any RGB buses, it will say the strip has RGB support. I still think the desired behavior should be returning the capability of the bus it's on, but oh well.
Segment has its own capabilities. It is available in the state object.
I'm sorry if this is super obvious and I'm just missing it, but I'm looking at the state and segment serialization functions, as well as the Segment class itself. But I just can't find it. Which field is it? Edit: I know each bus has a capability object that can be accessed through cfg/hw/led/ins[n]/type, but that only applies to buses
I beg your pardon, I mixed things up. It is the seglc
array in info
object, not state
.
What happened?
When querying the JSON API for the list of light capabilities by segment, it returns 1 (defined as "reserved"). However, querying cfg does give the correct value for each bus. The problem seems to lie in Segment::refreshLightCapabilities, or the fact that it is only called in these 2 contexts:
fixInvalidSegments
anddeserializeSegment
.fixInvalidSegments
is only called whendoInitBusses
is true, which can only be set when buses are changes via config deserialization, or by changing settings in the settings LED tab.I tried changing settings in the GUI and sending new configs and segments via JSON API and none updated the segment capability.
To Reproduce Bug
Expected Behavior
The segment should have the same capability as the bus it's on. (22 or TYPE_WS2812_RGB in my case)
Install Method
Binary from WLED.me
What version of WLED?
WLED 0.14.0 (build 2310130)
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
Anything else?
I kind of need this functionality for a project, and I'd be happy to help fix it
Code of Conduct