elero-usb-transmitter-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

elero-usb-transmitter-client

npm version build status

Elero USB Transmitter Client for node.js to send commands to Elero USB Stick and receive information. This libaray needs Elero Transmitter Stick (https://www.der-sonnenschutz-shop.de/elero-221250001-centero-transmitter-stick.html).

Features

  • send commands to control shutters
  • get current state of shutters

Installing

Using npm:

$ npm install elero-usb-transmitter-client

Example

Initialize

import { UsbTransmitterClient } from 'elero-usb-transmitter-client'
 
const client = new UsbTransmitterClient('/dev/ttyUSB0')

Creats a new client object. You have to use the path to the device as a parameter. Type npx @serialport/list in command line to get a list of serial devices.

Get information

import { UsbTransmitterClient } from "../src/UsbTransmitterClient"
 
//open connection to device
await client.open()
//get info of channel 1
const response = await client.getInfo(1)
console.log(response)
//close connection if it is not needed anymore
await client.close()

Writable properties of device

import { UsbTransmitterClient } from "../src/UsbTransmitterClient"
import { ControlCommand } from "../src/domain/enums"
 
await client.open()
//move shutters on channel 1 down
const response = await client.sendControlCommand(1, ControlCommand.down)
console.log(response)
await client.close()

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i elero-usb-transmitter-client

Weekly Downloads

4

Version

1.0.5

License

MIT

Unpacked Size

73.9 kB

Total Files

42

Last publish

Collaborators

  • marc2020