New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

telldus-api

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

telldus-api

Node API for Telldus Live and Telldus Local devices

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
9
28.57%
Maintainers
1
Weekly downloads
 
Created
Source

telldus-api

Node.js interface for Telldus Live API and Telldus Local API. Since their APIs are similar, I added support for both. All API methods are promise based. Both LiveApi and LocalApi inherit from the same class Api which has the same methods. However not all methods are implemented or make sense on LocalApi.

Install

npm install telldus-api

Live usage

  • You will need a Telldus Live account with configured devices and and OAuth tokens.
  • Log in to your Live account, go to http://api.telldus.com/ and Generate a private token for my user only.
const { LiveApi } = require('telldus-api');

const api = new LiveApi({
  key: '...', // publicKey
  secret: '...', // privateKey
  tokenKey: '...', // token
  tokenSecret: '...', // tokenSecret
});

const devices = await api.listDevices();
console.log(devices);

Local usage

TellStick ZNet Lite can be controlled via a similar API directly via HTTP. For more info, see this link.

  • Find the IP address of your TellStick device
  • Install telldus-local-auth: npm i -g telldus-local-auth
  • Run in a terminal telldus-local-auth <IP OF YOUR DEVICE> appname and follow instructions. appname can be set to whatever you want.
  • Note the returned token.
const { LocalApi } = require('telldus-api');

const api = new LocalApi({
  host: '...', // Host name or IP address of your device
  accessToken: '...', // The access token you got from telldus-local-auth
});

const devices = await api.listDevices();
console.log(devices);

The accessToken will be auto refreshed as long as there are API calls.

API

See class Api in index.js

FAQs

Package last updated on 27 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts