Socket
Book a DemoInstallSign in
Socket

milight-wifi-box

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

milight-wifi-box

Lightweight class for connecting to the MiLight wifi box

latest
npmnpm
Version
2.0.1
Version published
Weekly downloads
3
-40%
Maintainers
1
Weekly downloads
 
Created
Source

This is a lightweight class for communicating with the MiLight/LimitlessLED/AppLamp WiFi box.

Usage

const { MiBoxConnection } = require("milight-wifi-box");

//create the connection
const ip = "192.168.1.5";
const port = 5987; //optional
let miConnection = new MiBoxConnection(ip, port);

let group = 1;
let lightType = "rgbww"; //can be "rgbww", "rgbw", or anything else for the default
miConnection.sendOnCmd(lightType, group);
miConnection.sendBrightnessCmd(100, lightType, group); //brightness can be between 0-100
miConnection.sendHueCmd(255, lightType, group); //hue can be between 0-255
miConnection.sendSaturationCmd(100, lightType, group); //saturation can be between 0-100
miConnection.sendKelvinCmd(100, lightType, group); //for rgbww lights, kelvin can be between 0-100
miConnection.sendOffCmd(lightType, group);

//the group and lightType arguments are optional
//you can also change the default group and lightType like this
miConnection.defaultLightType = "rgbw"; //default is "rgbww"
miConnection.defaultGroup = 1; //default is 0
miConnection.sendOnCmd();
miConnection.sendBrightnessCmd(100);

//or additionally you can set the rgb of a light,
//this will automatically be converted to the right commands using hsv
miConnection.setRgb(255, 255, 0);

Keywords

milight

FAQs

Package last updated on 12 Feb 2020

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