partofthething / infopanel

Show live data, animations, pictures, or anything on simple displays like RGB matrices
https://partofthething.com/infopanel/
GNU General Public License v3.0
33 stars 12 forks source link

Image - dynamic path #1

Closed mountainsandcode closed 7 years ago

mountainsandcode commented 7 years ago

Cheers for setting up the project, was looking for something just like this!

I have a use case where I would like to set the path of an image sprite equal to an MQTT value, so that I can dynamically change what image gets shown. Would be awesome if you could consider adding that feature, I will try to dig through the code and see if I can't submit a PR myself otherwise.

partofthething commented 7 years ago

Hey, thanks! That sounds very doable, and like a useful feature. I'll try to add it.

partofthething commented 7 years ago

Ok! I added this feature in https://github.com/partofthething/infopanel/commit/266298d058353c27c969167cb94344dcf3eccb43. I did some basic testing of the new feature and I think it's working. Let me know how you like it and if it satisfies your need. I created a new command called image_path that you can send over mqtt. The payload is a packed string in the format spritename=newpath. So if you have a sprite called myimage that is set to /home/pi/images/flag.ppm, then you can send the mqtt payload myimage=/home/pi/images/newflag.ppm to the topic image_path and the sprite should update on all scenes it is added to.

mountainsandcode commented 7 years ago

@partofthething Awesome, cheers for implementing that so quickly! Currently travelling without physical access to my hardware, but I'll report back once I get a chance to test this IRL.

partofthething commented 7 years ago

My pleasure. I'm going to close assuming it's working. Just reopen if that's not true.