Create a repository for a plugin

Create the repository

Now the plugins sources are no more present in Domogik sources. Each plugin has its own GitHub (or elsewhere you want) repository. Thanks to this, everybody can now create its own plugin with version control without needing to request the Domogik team for an access.

You must name the repository like this : domogik-<type>-<name> :

  • domogik : this will allow everybody to find easily your plugin.
  • <type> : the package type. For a plugin, the package type is plugin.
  • <name> : the package name. It will be your plugin name : onewire, ipx800, plcbus, .... The package name must have a max length of 8 characters and be lower case. If needed you can use an underscore in the name. This limit is related to the xpl protocol.

Go on http://github.com, log in and create an account by clicking on the icon highlighted in yellow :

../../../../_images/create_repository_01.png

You will access to the repository creation form :

../../../../_images/create_repository_02.png

Fill the repository name, let the access as Public, set .gitignore to None (we will create our own file) and click on Create repository.

The repository is now created:

../../../../_images/create_repository_03.png

Clone the repository to start developing your plugin

In the right column, you can easily copy a link to clone the repository. To clone over ssh, just click on the SSH link:

../../../../_images/create_repository_04.png

And then, click on the icon highlighted in yellow to get the url in your clipboard:

../../../../_images/create_repository_05.png

You will have something like : git@github.com:fritz-smh/domogik-plugin-diskfree.git

Let’s say you will work in you home directory. Clone your repository:

$ cd $HOME
$ git clone git@github.com:fritz-smh/domogik-plugin-diskfree.git

If you want, you can activate the plugin on Domogik side:

$ cd /var/lib/domogik/domogik_packages
$ ln -s /home/youruser/domogik-plugin-diskfree plugin_diskfree

Notice that you could wait for your plugin to have a valid json first and then use the dmg_package tool to install it :

$ dmg_package -i $HOME/domogik-plugin-diskfree

Assuming you cloned an already working plugin, Domogik will automatically detect the plugin after a few seconds and you will be able to configure it and start it.

Be carefull : the symbolic link must be named like this : /var/lib/domogik/domogik_packages/[package type]_[package name]! You must use an underscore because python will not be able to see your plugin as a package is you use a minus.