[PLUGIN] RotaryEncoder II

I’m still not 100% sure I understand:
You want to use a 3.5" LCD display - ok. But what is it displaying and what is controlling it? Is it displaying the Volumio User Interface (UI) or are you writing a plugin or software that is generating some content to display?
There are two problems with your current approach:

  1. You can configure the RotaryEncoder2-plugin to send the getBrowseSources command via Websocket API, but the API will not know what to do with the payload up or down because getBrowseSources does not take any attributes
  2. When getBrowseSources sends its response, the plugin has no function to handle this response (event). You need separate code (e.g. plugin) to handle the event

What I tried to show you with my example:
You can call functions inside another plugin and perform actions from there. What you would need to do e.g. is to write some plugin (myplugin in the example) which for example contains a function up and a function down.
Now when you initialize your plugin, you call getBrowseSources and store the list you receive in an array. Then you display it on your LCD. Additionally you store, which item is selected and mark that on the display (e.g. inverted). Now the functions up/down would increment/decrement the selected index and update the display. Additionally, you need a function (e.g. select) that moves down one level (e.g. into Artists) and then calls browseLibraryon the selected source to receive the items on the next lower level.
So you need to implement the navigation in your own plugin, that interacts with your display and you can use the rotary to call functions in your own plugin.
I do not want to provide this functionality in the rotary-encoder plugin, because it unnecessarily blows up the size and will break the idea of modularity. Also, there are many displays in the market which would all need a different code.
I am currently working on a plugin that works with an 1.6" LCD display (this is where I took the example), but it is not yet good enough for publishing and I currently have only little time to work on it (see Image 1 & 5 here).