GitXplorerGitXplorer
t

leviton-js

public
2 stars
2 forks
1 issues

Commits

List of commits on branch master.
Verified
5a646e974de4cc9bad3f3f3744e4d2c774724909

Merge pull request #1 from tabrindle/dependabot/npm_and_yarn/lodash-4.17.19

ttabrindle committed 4 years ago
Verified
c8eb0565a86744d63c76b0a3cb44a6989abddba1

chore(deps): bump lodash from 4.17.15 to 4.17.19

ddependabot[bot] committed 4 years ago
Unverified
e55fab8ad241fe058a0f9251975b9ceb59c4326a

chore: add jsdoc for functions

ttabrindle committed 5 years ago
Unverified
2dbbb55ca675d3d3df6e8e8fee77e23a642df2dc

initial commit

ttabrindle committed 5 years ago

README

The README file for this repository.

leviton-js

Overview

A simple API wrapper for using Leviton Decora Smart Wifi switches and outlets. Tested using models:

  • DW1KD
  • DW15P
  • DW6HD
  • DW3HL

Installation

yarn add or npm install

Usage

Get access token and person ID:

postPersonLogin({
  email: 'your@email.com',
  password: 'supersecretpassword'
})
  .then(console.log)

Get user permissions and account ID

getPersonResidentialPermissions({
  personID: 'asdfasdf-asdfasd-asdfasdf-asdf,
  token: 'asdf1234'
})
  .then(console.log)

Get primary residence ID

getResidentialAccounts({
  accountID: '45674567',
  token: 'asdf1234'
})
  .then(console.log)

Get list of switches + switch IDs

getResidenceIotSwitches({
  residenceID: '123456',
  token: 'asdf1234'
})
  .then(console.log)

Get information on a given switch

getIotSwitch({
  switchID: '654332',
  token: 'asdf1234'
})
  .then(console.log)

Update a switch power or brightness state

putIotSwitch({
  switchID: '654321',
  power: 'ON',
  brightness: '100',
  token: 'asdf1234'
})
  .then(console.log)

Look at test.js for a complete working example integration test