Closed fherbet closed 2 years ago
Hi @fherbet,
Thanks for your feedback! I just pushed a commit to allow setting effects for multiple devices via the API. Please use the branch https://github.com/TobKra96/music_led_strip_control/tree/dev_2.3 and test if your strips won't have the delay.
The body for the API call should be like in this example:
{
"devices": [
{
"device": "device_0",
"effect": "effect_single"
},
{
"device": "device_1",
"effect": "effect_gradient"
}
]
}
I will also update the API documentation with more examples later.
Merged into branch dev_2.3. Thank you 👍
thanks guys !
i have tried updating MLSC using below command :
curl -sSL https://raw.githubusercontent.com/TobKra96/music_led_strip_control/master/setup.sh | sudo bash -s -- -b dev_2.3
but i'm still running stable 2.2 (master)
what would you suggest to run MLSC branch dev_2.3 ?
thanks !
Edit :
looks like i did it with
root@ledstrip:/share/music_led_strip_control# git branch dev_2.3
root@ledstrip:/share/music_led_strip_control# git pull origin dev_2.3
From https://github.com/TobKra96/music_led_strip_control
* branch dev_2.3 -> FETCH_HEAD
then
pi@ledstrip:~ $ sudo systemctl stop mlsc.service
pi@ledstrip:~ $ sudo systemctl start mlsc.service
API for multiple device via your function "set_active_effect_for_multiple" now works ! using that py code
def seteffect(data):
r = requests.post(url + '/api/effect/active', json=data)
if sys.argv[1] == ('gradient') :
jsondata={
"devices": [
{
"device": "device_0",
"effect": "effect_gradient"
},
{
"device": "device_1",
"effect": "effect_gradient"
}
]
}
seteffect(jsondata)
delay is now close to 0 sec ! wonderful job guys !! really awesome project!
Hi !
1st of all, thanks a ton for this wonderful project ! i have now a main ledstrip driven by a pi3 + 2nd one connected to NodeMCU that are on both side of my sofa and both hidden in vertical lamps! vu meter effect really rocks while listening to music!
i'm now planning to build many more NodeMCU satellites for other rooms !
currently , i'm trying to integrate this into my domotic station (jeedom) via python scripts and requests library to interact with MLSC REST API.
all works fine except that i'm trying to find a way to set same effect on 2 devices at the same time (and not all devices because they're not in same room.)
obv when i use this code, both devices acts in a synchronized way
when i use that one, i get a delay between both 'seteffect'
looks like it's not possible to have a single json object to push effect on several devices like json object we get when we retrieve devices effect > GET /api/effect/active > Return active effect
Am I wrong ? or i just missed something ?
thanks very much !