# mewo-pi-device

> A MeWo device wrapper for Raspberry Pi GPIO

Latest version **1.0.0** (published 2016-06-06) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install mewo-pi-device
pnpm add mewo-pi-device
yarn add mewo-pi-device
bun add mewo-pi-device
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-06-06 |
| First published | 2016-06-06 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.0.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Hackmann |
| Maintainers | dxprog |
| Keywords | raspberry pi, amazon echo, home automation |

## Links

- npm: https://www.npmjs.com/package/mewo-pi-device
- Repository: https://github.com/dxprog/mewo-pi-device
- Homepage: https://github.com/dxprog/mewo-pi-device#readme
- Issues: https://github.com/dxprog/mewo-pi-device/issues
- npm.io page: https://npm.io/package/mewo-pi-device

## Dependencies (2)

- [mewo](https://npm.io/package/mewo.md) ^1.0.0
- [rpi-gpio](https://npm.io/package/rpi-gpio.md) ^0.7.0

## Recent versions

- 1.0.0 (latest) — 2016-06-06

## README

[![Build Status](https://travis-ci.org/dxprog/mewo-pi-device.svg)](https://travis-ci.org/dxprog/mewo-pi-device)

# MeWo Pi Device

A node library that allows a MeWo emulated hub to control GPIO pins on a Raspberry Pi.

## Installation

```
npm install --save mewo-pi-device
```

**Note:** GPIO pins can only be controlled while running as root.

## API

`PiDevice(deviceName, responder, [ pins ])`

Object constructor.

- `deviceName`: The name of the device
- `responder`: The UPnpBroadcastResponder object
- `pins`: A pin number or array of pin numbers for this device to control

## Example

```javascript
const { UPnpBroadcastResponder } = require('mewo');
const { PiDevice } = require('mewo-pi-device');

const GPIO_PIN = 40;

const responder = new UPnpBroadcastResponder();
responder.init().then(() => {
  const piDevice = new PiDevice('pi-device', responder, GPIO_PIN);
  responder.registerDevice(piDevice);
});
```

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