Developer Plugin update - GPIOs, Buttons and enhancements (Patreon)
Downloads
Missing 1 file, as this post has not yet been imported.
Content
The plugin release is going through the review paces and more progress has been made. Next up is a beta release, and then a few days later a full release with a full image for November.
Meanwhile I'm running through developing plugins or testing plugins to ensure that developers will have a ton of tools to use for extensability. One important request that I wanted plugins to handle was the ability to talk to the pi via GPIOs to allow for different sensors, buttons and more. This means that scenarios such as 'PIR' sensors can start turning frames on or off based on movement, or buttons could be added for controlling forward/back or select playlists.
To have a button, or any extensability, play a specific playlist we needed the ability to play multiple playlists with one command. To that end, I've added 3 commands to the HTTP APIs:
1) SETSUBDIRECTORIES - This command can take multiple directories which can be comma separated. This command turns off all playlists, and then sets any playlists that are passed as 'on'. This allows home automation or developers to set multiple plugins at the same time with one call.
2) ADDSUBDIRECTORIES - This is similar to SETSUBDIRECTORIES, but it doesn't clear whatever else is playing. This just allows multiple to get added.
3) DELETEDIRECTORY - IMPORTANT: This will DELETE the files and directory that get passed! This is critical to understand...it's the only API we provide so far that is destructive and will actually remove files...this will be hooked up in the UI soon to fulfill the often requested feature of being able to delete the folder. For now for enthusiasts it's provided to help with more advanced scenarios until it's hooked up into the webpage itself.
The video shows some sample code of a simple plugin that takes a request command to pass the SETSUBDIRECTORIES command to the frame. This simple script allows for one button to set one playlist, and one for another. Many more buttons could be added, and you can use a simliar concept to have a PIR sensor turn the frame on/off, or other scenarios. My goal with this was to get the code out there and ensure it works, and then let the community bend it to their will!
Thankyou for watching and reading. Progress on the next release is happening and I will keep working on plugins and such in the meantime. The more sample code I can get out there the faster we can all take advantage of it, and then get plugins into the store so the whole community can take advantage of them!