Coder Social home page Coder Social logo

maxschremser / ambilight Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 0.0 272 KB

An API library for Node.js that interacts with a Philips Ambilight TV.

Home Page: https://www.npmjs.com/package/ambilight

License: Other

JavaScript 98.77% Makefile 1.23%

ambilight's Introduction

ambilight

An API library for Node.js that interacts with a Philips Ambilight TV.

This API provides all documented features and a set of useful functions to control the tv remotely. This API abstracts away the Philips Ambilight REST API. This project is based on the [email protected] project by Peter Murray. As in the HUE API, the Ambilight API supports for each function a callback and if omitted a promise will be returned for use in chaining.

Change Log

For a list of changes, please refer to the changelog. ChangeLog

Installation

$ npm install ambilight

Philips Ambilight Resources

There are plenty of resources about ambilight on the internet, but the best technical description is probably your own tv (http://<ip-address>:1925/1/doc/API.html). You may need to enable jointSPACE by entering the following digit sequence while watching TV.

5646877223

Work in Progress

Currently I am writing new tests to test the REST endpoints. Especially the POST requests have not been tested truely.

API

var ambilight = require('ambilight')

Examples

Getting the Topology

The Topology of the ambilights is an object with the amount of lightstrips mounted to the TV. My TV (Philips 46PFL8007K/12) has 5 lights mounted to the left and right and 10 on the top, bottom is zero. To query the Topology use the following snippet:

var ambilight = require('ambilight');

var showResult = function (result) {
    console.log(JSON.stringify(result));
};

var host = "192.168.0.11",
    api = new ambilight.AmbilightApi(host);

// Using a Promise
api.getTopology().then(showResult).done();

// Using a Callback
api.getTopology(function (err, result) {
    if (err) throw err;
    showResult(result);
});

The resulting output looks like this:

{"layers":1,"left":5,"top":10,"right":5,"bottom":0}

A full list of examples can be found inside the examples directory.

ambilight's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.