iobroker.sensate
Version:
Connector to the Sensate Platform
60 lines (49 loc) • 3.41 kB
Markdown

# ioBroker.sensate
[](https://www.npmjs.com/package/iobroker.sensate)
[](https://www.npmjs.com/package/iobroker.sensate)


[](https://david-dm.org/sensate-io/iobroker.sensate)
[](https://snyk.io/test/github/sensate-io/ioBroker.sensate)
[](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