# openmoticsjs

> OpenMotics JavaScript interface

Latest version **0.2.5** (published 2016-01-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install openmoticsjs
pnpm add openmoticsjs
yarn add openmoticsjs
bun add openmoticsjs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2016-01-06 |
| First published | 2016-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alessandro Pezzato |
| Maintainers | pezzzz |
| Keywords | openmotics, home, automation |

## Links

- npm: https://www.npmjs.com/package/openmoticsjs
- Repository: https://github.com/alepez/openmoticsjs
- Homepage: https://github.com/alepez/openmoticsjs#readme
- Issues: https://github.com/alepez/openmoticsjs/issues
- npm.io page: https://npm.io/package/openmoticsjs

## Dependencies (3)

- [q](https://npm.io/package/q.md) ^1.4.1
- [request](https://npm.io/package/request.md) ^2.67.0
- [browser-request](https://npm.io/package/browser-request.md) ^0.3.3

## Recent versions

- 0.2.5 (latest) — 2016-01-06

## README

# OpenMotics JS

OpenMotics SDK for communication with the OpenMotics Gateway.

JavaScript port of the [OpenMotics SDK](https://github.com/openmotics/sdk).

## Install

Can be installed with bower: `bower install --save openmoticsjs`

## Usage

It works with [Node.js](https://github.com/nodejs/node) and in browsers.

See `test/test.js` for example in node.

### Angular.js

Supports `$q` promises and `$http` service, so you can do this:

```
  var gateway = window.OpenMoticsApi({
    username: 'foo',              // Needed
    password: 'bar',              // Needed
    hostname: 'openmotics.local', // Default: localhost
    port: '443',                  // Default: 443
    https: true,                  // Default: true
    q: $q,                        // Needed
    http: $http,                  // Needed
  });
```

### Proxy

If you are using a proxy to avoid *CORS* and https requests, you can disable
ssl and add a prefix:

```
  var gateway = window.OpenMoticsApi({
    ...
    port: '8000',
    https: false,
    prefix: '/api'
  });
```

---
_Source: https://npm.io/package/openmoticsjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
