I think there might be an issue where the object key should be used instead of the index as if it were an array. I've probably deleted lights before on my hue, which is probably why I have some gaps. I notice when querying my hue that the light keys start at 3 instead of 1 or 0. I have a light at index 6, but it's named 9 in my status object (at http://hueip/api/user) if I query my base station. I noticed when I tried to turn on and off the light named Entryway, the light named 6 would toggle itself on and off. I temporarily got around this by directly adding 3 to the index value to prove the concept to myself.
BUT I don't think that will always work. For example, as you can see, I don't have a light named "13" here. So the "index" offset would keep changing. Is there a way to pass the object key here instead of the index?
In src/action/message/HueTurn.ts, round about line 25 there's some indication that we're only able to manipulate lights at index 2 right now. Is that correct?
I've verified via direct PUT requests that the URL works, but I'm not able to change a light at say index 9 without directly changing the index that's hardcoded in. I verified that also and was able to then make hue turn on work via Discord.
I'm assuming that additional work is still needed to gather the index specified from the message based on the name and then pass that into the URL that's getting constructed.