You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ikettle

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ikettle

A library for interacting with the iKettle

0.1.0
latest
v0.1.0
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Node iKettle

Build
Status GitHub version Dependency Status devDependency Status

This library enables easy access to an iKettle. Much of the knowledge for interacting with the iKettle was from Mark Cox's blog article, "Hacking a Wifi Kettle".

var iKettle = require("ikettle");

Currently the functionality is read-only, ie. iKettle state can be read and is updated as the kettle state changes. If it on roadmap to provide write access to kettle state.

Please see the scripts in the examples directory for ways in which this library can be used.

Connecting to your iKettle

iKettle.connect(port, host, function(err, state) {
  if (err) {
    return;
  }
  // Use state model here
});

The default port for the iKettle is 2000.

Calling connect will confirm that the host is an iKettle and will retrieve the current state which is used to populate the model.

The callback function follows the nodejs convention, If an error has occurred, the first parameter err will be an Error object and model will be undefined. If an error has not occurred, err will be null and state will be a Backbone model.

iKettle state

This state model is held in a Backbone model. It is provided as a parameter to the connect callback, or via iKettle.state.

In depth information on using Backbone models can be found in the Backbone documentation, but basic usecase for using the model:

Checking if the kettle is on

var is_kettle_on = state.get("on");

Monitoring kettle state changes

state.on("change", function(details) {
  var what_changed = details.changes;
});

Closing the connection

iKettle.destroy();

This will close the connection to the iKettle and destroy the state model.

Upcoming

  • Sync changes to state model back to the iKettle
  • Have periodic sync with iKettle to confirm state model holds correct state

Contact

Twitter @alistairjcbrown

Code signed using keybase as alistairjcbrown. Verify with keybase dir verify

FAQs

Package last updated on 02 Jan 2015

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.