npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yeelight-platform

v1.0.10

Published

Yeelight Platform

Downloads

51

Readme

yeelight-platform

NPM

npm npm CircleCI

Yet Another Yeelight API written in JS

Description

This package supports discovering, connecting and controlling Yeelight Devices. yeelight-platform is a zero-dependency solution for controlling Xiaomi/Yeelight Lights. There are already a number of other solutions available, but they were not exactly what I wanted, so I made another one to be better than all the others.

Installation

    $ npm install yeelight-platform

Usage :

Discover

    const YeeDiscovery = require('yeelight-platform').Discovery
    const discoveryService = new YeeDiscovery()

    discoveryService.on('started', () => {
        console.log('** Discovery Started **')
    })

    discoveryService.on('didDiscoverDevice', (device) => {
        console.log(device)
    })

    discoveryService.listen()
    /*
        {
            Location: 'yeelight://192.168.x.x:55443',
            id: '0x000000000xxxxx',
            model: 'bslamp1',
            support:
            'get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_ct_abx set_rgb set_hsv set_adjust adjust_bright adjust_ct adjust_color set_music set_name',
            power: 'off',
            bright: '1',
            color_mode: '1',
            ct: '2752',
            rgb: '16750592',
            hue: '36',
            sat: '100'
        }
    */

Device

    const YeeDevice = require('yeelight-platform').Device

    const device = new YeeDevice({host: "192.168.0.190", port: 55443})

    device.connect()

    device.on('deviceUpdate', (newProps) => {
        console.log(newProps)
    })
    
    device.on('connected', () => {
        device.sendCommand({
            id: -1,
            method: 'set_power',
            params: ["on", 'smooth', 300]
        })
    })    

Compatible Devices

https://www.yeelight.com/en_US/product/wifi-led-c

https://www.yeelight.com/en_US/product/luna-mc

https://www.yeelight.com/en_US/product/luna

https://www.yeelight.com/en_US/product/mijia-lamp

https://www.yeelight.com/en_US/product/lemon-color

https://www.yeelight.com/en_US/product/lemon-ct

https://www.yeelight.com/en_US/product/pitaya-plus

https://www.yeelight.com/en_US/product/eos

https://www.yeelight.com/en_US/product/cherry1s

https://www.mi.com/us/yeelight-led-light-bulb/

https://www.mi.com/us/mi-bedside-lamp/

Lint

    $ npm run lint

API :

Yeelight Official API Documentation

https://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf

Author

Sahil Chaddha

[email protected]