Closed GithubuserLED closed 3 years ago
Hi,
you have to send a post, not a get:
import requests
payload = {'effect' : 'effect_single'}
r = requests.post("http://<IP>:8080/SetActiveEffectForAll", json=payload)
For me, this code works. Let me know if you have problems with it. Have a great day!
I would like to be able to control the rest API via Python. So i thought i can use the 'requests' and the 'json' libary. Then I wrote a tiny Python script including this:
payload = {'effect' : 'effect_off'} r = requests.get("http://pi-ip-adress/SetActiveEffectForAll", json=payload)
When I am running the script from the MLSC returns:
"GET /SetActiveEffectForAll HTTP/1.1" 405 -
But the light is not changing, so i think the request must be wrong.
what do I have to change so the payload is right?