UNPKG

iobroker.sensate

Version:

Connector to the Sensate Platform

60 lines (49 loc) 3.41 kB
![Logo](admin/sensate.png) # ioBroker.sensate [![NPM version](http://img.shields.io/npm/v/iobroker.sensate.svg)](https://www.npmjs.com/package/iobroker.sensate) [![Downloads](https://img.shields.io/npm/dm/iobroker.sensate.svg)](https://www.npmjs.com/package/iobroker.sensate) ![Number of Installations (latest)](http://iobroker.live/badges/sensate-installed.svg) ![Number of Installations (stable)](http://iobroker.live/badges/sensate-stable.svg) [![Dependency Status](https://img.shields.io/david/sensate-io/iobroker.sensate.svg)](https://david-dm.org/sensate-io/iobroker.sensate) [![Known Vulnerabilities](https://snyk.io/test/github/sensate-io/ioBroker.sensate/badge.svg)](https://snyk.io/test/github/sensate-io/ioBroker.sensate) [![NPM](https://nodei.co/npm/iobroker.sensate.png?downloads=true)](https://nodei.co/npm/iobroker.sensate/) ## Developer manual This section is intended for the developer. It can be deleted later ### Best Practices We've collected some [best practices](https://github.com/ioBroker/ioBroker.repositories#development-and-coding-best-practices) regarding ioBroker development and coding in general. If you're new to ioBroker or Node.js, you should check them out. If you're already experienced, you should also take a look at them - you might learn something new :) ### Scripts in `package.json` Several npm scripts are predefined for your convenience. You can run them using `npm run <scriptname>` | Script name | Description | |-------------|-----------------------------------------------------------------------| | `test:js` | Executes the tests you defined in `*.test.js` files. | | `test:package` | Ensures your `package.json` and `io-package.json` are valid. | | `test` | Performs a minimal test run on package files and your tests. | | `lint` | Runs `ESLint` to check your code for formatting errors and potential bugs. | ### Writing tests When done right, testing code is invaluable, because it gives you the confidence to change your code while knowing exactly if and when something breaks. A good read on the topic of test-driven development is https://hackernoon.com/introduction-to-test-driven-development-tdd-61a13bc92d92. Although writing tests before the code might seem strange at first, but it has very clear upsides. The template provides you with basic tests for the adapter startup and package files. It is recommended that you add your own tests into the mix. ### Publishing the adapter To get your adapter released in ioBroker, please refer to the documentation of [ioBroker.repositories](https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository). ### Test the adapter manually on a local ioBroker installation In order to install the adapter locally without publishing, the following steps are recommended: 1. Create a tarball from your dev directory: ```bash npm pack ``` 1. Upload the resulting file to your ioBroker host 1. Install it locally (The paths are different on Windows): ```bash cd /opt/iobroker npm i /path/to/tarball.tgz ``` For later updates, the above procedure is not necessary. Just do the following: 1. Overwrite the changed files in the adapter directory (`/opt/iobroker/node_modules/iobroker.sensate`) 1. Execute `iobroker upload sensate` on the ioBroker host