ioBroker / ioBroker.repositories

Repositories for ioBroker project
MIT License
136 stars 285 forks source link
iobroker repository

ioBroker.repositories

This is GitHub project for storage of latest and stable repositories.

last refresh beta last refresh stable

Update of the version in stable

  1. Be sure that the version is tested in forum by users, or you fix the critical bug with that.
  2. Delete the versionTime, if exists

Add a new adapter to the latest repository

  1. Fork this repo and clone your fork
  2. Run npm i
  3. Run npm run addToLatest -- --name <adapter-name> --type <adapter-type>
    (replace <adapter-name> with your adapter's name (without 'iobroker.' prefix) and <adapter-type> with the adapter type)
  4. Push a commit with the changes to sources-dist.json
  5. Create a PR

Add a new adapter to the latest repository (web frontend)

  1. Go to iobroker.dev
  2. Log in with GitHub
  3. Open the new adapter
  4. Click on manage
  5. Click on action "ADD TO LATEST"

Requirements for adapter to get added to the latest repository

Already required for the latest repository

  1. Your GitHub repository must have the name - ioBroker.<adaptername>. B is capital in "ioBroker", but in the package.json the name must be low case, because npm does not allow upper case letters. Your repository must have "topics". Add these with Manage topics.
  2. Do not use in the title the words ioBroker or Adapter. It is clear anyway that this adapter is for ioBroker.
  3. title in io-package.json (common) is simple short name of adapter in english. titleLang is object that consists short names in many languages. Lang ist not german Länge, but english LANGuages.
  4. Adapter needs to have a README.md with description, detail information and changelog. English is mandatory. Other languages are welcome. See Example of README.md.

    In README.md, there must be a link to the device or the manufacturer's website. Devices must have a photo. Services do not require a photo, but are still welcome.

  5. Adapter must have a predefined license.
  6. Please remove www, widgets and docs directories (admin/tab_m.html, admin/custom_m.html) if not used.
  7. Adapter needs to have at least Adapter basic testing (installing, running) using GitHub actions. More information in Forum from apollon77 (Just take from other adapters the samples)
  8. Define one of the types in io-package.json. See details here
  9. Define one of the connection types (if applied) in io-package.json. See details here
  10. All states must have the according valid roles (and not just "state")
  11. Include author in io-package.json and authors in io-package.json. See here.
  12. Adapter needs to be available as package on npmjs.com. See How to publish on npm
  13. iobroker organisation must be added as an owner to npm package. Why and how to do that.
  14. Add your adapter into the list (first latest and after that into stable, when tested). Examples of entries you can find here.
  15. No new adapters will be accepted to repo without admin3 Configuration dialog. Admin2 dialog is optional!
  16. Port attribute must have name port.
  17. Check and follow the coding best practices listed below.

Note: you can watch the video about it (only german) on YouTube Note: There is a helper https://adapter-check.iobroker.in/ to check many points automatically. Just place your GitHub adapter repo there, e.g. https://github.com/ioBroker/ioBroker.admin and press enter or on the check button.

Development and Coding best practices

Add a new adapter to the stable repository

  1. Fork this repo and clone your fork
  2. Run npm i
  3. Run npm run addToStable -- --name <adapter-name> --version <stable-version>
    (replace <adapter-name> with your adapter's name and <stable-version> with the version that should be added to the stable repo)
  4. Push a commit with the changes to sources-dist-stable.json
  5. Create a PR

Requirements for adapter to get added to the stable repository

Additionally, to all above listed points:

  1. The adapter must have been added to the latest repository previously.
  2. Forum thread with question to test the adapter.
  3. Some feedback on forum.
  4. Important Discovery function! If a device can be found automatically (USB, IP) it should be implemented in discovery adapter after (Discovery PR will be merged after stable acceptance).

Common Rules and Requirements for Commercial Adapters Requiring a License

ioBroker GmbH sponsors all infrastructure and services necessary for the smooth functioning of the ioBroker world. This encompasses the repository, central components, and platforms such as the Forum. While the usage of open-source "non-commercial" adapters is entirely free, the scenario changes when adapters necessitate a purchase.

For an optimal experience, it is recommended to procure licenses through the official ioBroker Website. The ioBroker GmbH facilitates license management and provides secure components for seamless integration into the adapter. In return for this service, a standard share of 30% of revenues is remitted to ioBroker GmbH. For further information or inquiries, please reach out to info@iobroker.net.

In cases where purchases are managed by the developer directly, and the adapter is intended for inclusion in the repository, a service fee of typically 15% of the revenue is applicable. For details and negotiations regarding this arrangement, please also contact info@iobroker.net.

How-to

How to publish on npm

https://docs.npmjs.com/getting-started/publishing-npm-packages

Add an owner to a packet

We are really happy that other developers are contributing to ioBroker. But some of them with the time lost the enthusiasm and stopped support and maintaining the adapter.

There is no problem with GitHub repository. We can just fork it and maintain it in our organisation, but the situation with npm is different.

If some name is blocked (e.g., iobroker.rpi) we cannot publish the changed adapter under the same name, we must change the name to e.g., iobroker.rpi2.

Then we must change the ioBroker repositories, and the user must install the new adapter and migrate the old settings and objects into new adapter.

This is not suitable.

Because of that, we ask you to give ioBroker organisation publish rights to update the npm package. We will use it only in emergency, or if the author does not react to our requests.

To add the ioBroker organisation to npm packet, you must write the following after the packet is published:

npm access grant read-write iobroker:developers iobroker.<adaptername>

If the command does not work, just add bluefox as an owner.

npm owner add bluefox iobroker.<adaptername>

Attention: bluefox must accept the invite. This might last a day or two. So please be patient until the invite has been accepted. If invite expires, please retry (send a second invite).

Example of README.md

https://github.com/ioBroker/ioBroker.admin/blob/master/README.md

Much better is to write documentation separately for every language like here:

https://github.com/ioBroker/ioBroker.admin/blob/master/io-package.json#L171

and the files are here https://github.com/ioBroker/ioBroker.admin/tree/master/docs

And make the link in your readme file to these files, like here: https://github.com/ioBroker/ioBroker.javascript/blob/master/README.md

Licenses

The following licenses are used now in ioBroker project:

You can choose the suitable license here: https://ufal.github.io/public-license-selector/

Of course, you can add your own licenses, even WTFPL.

You must, of course, take in count the licenses of components that are used in your adapter. E.g., if you use the main packet under GPLv2 license, you cannot make CC-BY-NC from that.

Testing

The Adapter Creator will create all needed files and deps for the testing, see also https://github.com/ioBroker/ioBroker.example/tree/master/JavaScript/test . Tests are then run by GitHub Action (also pre-generated)

Types

The io-package.json must have an attribute type in common part. An example can be seen here:

You can see the types of existing adapters here and try to find the similar one.

Connection types

If your adapter controls some device/car/house the adapter could be connected with various methods and receive data via different protocols.

Define connectionType in common part of io-package.json as:

Define dataSource in common as:

Defined categories for non-repo adapters

Authors

Please define the following attributes in package.json :

Samples

For latest (sources-dist.json):

  "admin": {
    "meta": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/io-package.json",
    "icon": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/admin/admin.png",
    "type": "general"
  },

For stable (sources-dist-stable.json):

  "admin": {
    "meta": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/io-package.json",
    "icon": "https://raw.githubusercontent.com/ioBroker/ioBroker.admin/master/admin/admin.png",
    "type": "general",
    "version": "2.0.7"
  },

Note: stable always has a specific version.

Automatic pull request checker

On every pull request to the repository, the GitHub Action will be triggered (see check.yml ). It will check the following things:

Issues to move the latest version of adapter to stable

Every night the GitHub Action will be triggered at 3:15 (see stable.yml ). It will check the following things:

How is the repository build?

The repository is build executing npm run build. However, this is currently only done on a dedicated server running on AWS. However, before build the repository is pulled and thus uses the code from the repository. Hence, modifications how the repo is built should be made against this repository.