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

homebridge-bslamp2

v1.0.6

Published

Homebridge plugin to control Mi Bedside Lamps 2

Downloads

30

Readme

homebridge-bslamp2

Homebridge plugin to control Mi Bedside Lamps 2

Install

sudo npm install -g homebridge-bslamp2

Requirements

  • the Lamps needs a static IP.
  • you need the homekit pairing code from the lamp

Configuration

With the plugin comes a CLI tool which can be executed with bslamp (see usage at next section). sudo is (mostly) needed as usually the user doesn't have write rights in the modules directory. After the pairing it generates a copy-pastable homebridge accessory conig. e.g.:

pi@raspberrypi:~ $ sudo bslamp pair 192.168.0.123 098-76-543
Search Device........
Found MiBedsideLamp2-7A5C
Start pairing
MiBedsideLamp2-7A5C successfully paired!

Paste the following into your homebridge config
'name' is what you see in homebridge/homekit and can be changed
===========COPY START===========
{
    "accessory": "MiBedsideLamp2",
    "name": "Mi Bedside Lamp 2",
    "id": "1F:5E:75:AF:D5:06",
    "address": "192.168.0.123",
    "port": 80,
    "pairingData": {
        "AccessoryPairingID": "12312a45645a78978a12312a45645a7890",
        "AccessoryLTPK": "1d3c8db26d21a66d37535a6a7892f5aaa33a8ba86c63ef3456890c253a2636ce",        
        "iOSDevicePairingID": "360342967342985723409587234576139874634206895435678934058123095634759086",
        "iOSDeviceLTSK": "1424f4ed6b24c5b78e2938475b3edc395619433a32ce1252cb4c8856c0faaf4daae82ac6c560de5c365dcba87c4024ebb309896d2d8c267344ff6a52794ae194c",
        "iOSDeviceLTPK": "fae66ac3c263de3c647dcba46c8643ebb245757d3d5c87974ff3a25143ae689c"
    }
}
============COPY END============

Usage bslamp

bslamp help
=================================
Usage pair: bslamp pair [ip address] [pairing code]
 - e.g.  'bslamp pair 192.168.0.123 012-34-567'

Usage unpair: bslamp unpair [filename]
 - [filename] is 'bslamp-' and the IP address of the device with '-' instead of '.'
 - e.g.  'bslamp unpair bslamp-192-168-0-123'

Changelog

1.0.6

  • fixed bad error handling

1.0.5

  • update dependencies

1.0.4

  • close hap-controller client connection after 3 seconds without user input
  • create a new client if the current one has problems or no one is available
  • improve subscription stability
  • better state handling

1.0.3

  • fix wrong dependency in package.json

1.0.2

  • updated to newest hap-controller package
  • complete rewritten all hap client functions to improve stability

1.0.1

  • changed scope of the saved states to work with muliple lamps
  • switched to promise-based Characteristic.onSet / .onGet methods