@gordalina/magic-home

1.2.0 • Public • Published

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:*

/@gordalina/magic-home/

    Package Sidebar

    Install

    npm i @gordalina/magic-home

    Weekly Downloads

    4

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    30.6 kB

    Total Files

    9

    Last publish

    Collaborators

    • gordalina