NimmLor / esp8266-fastled-iot-webserver

A universal software for all my LED projects, with many awesome features
https://www.thingiverse.com/surrbradl08/designs
GNU General Public License v3.0
366 stars 94 forks source link

Document API endpoints #196

Open sn1ce opened 2 years ago

sn1ce commented 2 years ago

Hi there,

first of all, very cool project, i use this in like 5 lights currently.

I just wanted to know the correct api post request for solidColor.. Just red the code, but can't manage to find the correct syntax for it.

For the pattern it was easy

/pattern?value=56 (solid Color)

But when i try to use the solidColor in my POST (using curl in bash) /solidColor?255,255,255

it says: not found. Even in my webbrowser..

Can you guys maybe give a hint or a well documented version of all api requests?

Much appreciated! Best, sn1ce

WarDrake commented 2 years ago

The correct address to call is : /solidColor?r=255&g=255&b=255

as for pattern, use : /patternName?value=Solid%20Color

the 56 is dependent on the number of patters available and/or visualizations so it might not be the same across different installations or configurations and might change on version updates. (mine is 57)

while using patternName will always yield the expected one

sn1ce commented 2 years ago

Hi again, thanks for your quick response.

i tested your call and it's also saying "not found".

I am using commit 527148dae745351b5b6256acb4c598b30aa4fba2 (HEAD -> master, tag: 4.2) Merge: a1e2c54 dda3a05

Any ideas what i am doing wrong?...

Best,

sn1ce

// EDIT

Yes, it was my fault. I am using a to old version. Just updated it to the current one, works like a charm. And nice "turn on"-effect!

Many thanks.

For the documentation, i would recommend to create a new collum, "examples". I am not that familiar with coding like this. Maybe some others to.

Have a nice weekend!

sn1ce

bb-Ricardo commented 2 years ago

Hi,

Good point. Some examples should be added to the documentation.