Giter VIP home page Giter VIP logo

magic-home's Introduction

Magic Home

Install

npm install @gordalina/magic-home --save
# or
yarn add @gordalina/magic-home

API

import { Light } from '@gordalina/magic-home'

// this will scan the local network for lights
const devices = await Light.scan();

// this will establish network connection to the light
const light = new Light(devices[0]);

// light methods
await light.on();
await light.off();
await light.color(0xFF, 0, 0); // red
await light.brightness(0xFF, 0, 0, 50); // red with 50% brightness
await light.pattern('red_green_cross_fade', 1);
const patterns = light.patterns();
const state = await light.state();

Debug

You can enable debug environment variable to see what's happening under the hood by setting the DEBUG environment variable:

DEBUG=magic-home:*

magic-home's People

Contributors

gordalina avatar

Stargazers

Geoff Holden avatar Laco Skokan avatar James Phipps avatar Erik Slovák avatar Dan Bovey avatar

Watchers

James Cloos avatar  avatar

Forkers

danbovey

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.