OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Plugin installation – opinions please Re: Re: Plugin installation – opinions please

#27720

Samer
Keymaster

The idea behind the XML/JSON is you can add things like modules. You basically build a small installer in OSPi that reads the info and does what’s needed. For example:


OSPi-Plugins <--- Main repo
weather_adj/ <---top dir, represents plugin
templates/ <--- subdirectory containing template files (the installer can auto prefix them to prevent collision)
modules/ <--- subdirectory containing modules to be installed (the installer can check if already installed and skip)
source/ <--- subdirectory containing python code (installer will move this to the plugin directory with the plugin name)
weather_adj.py <--- main plugin code
package.json <---- holds info represented below

That would be the basic layout and the package.json would have the info for OSPi to use like this:


{
"name": "Weather Adjust",
"version": "1.0.0",
"description": "Allows weather based rain delay activation.",
"author": "Samer Albahra"
"modules": "apscheduler"
}

The modules can be just a name and the installer would grab them or you can add a folder and manually install them as suggested above. I think in the long run this system will be easier to find and use plugins.

Update: I already see ways to clean that up so of course this isn’t a final implementation by anyways but an example to represent what I had in mind.