How to use tplink-lightbulb - 1 common examples

To help you get started, we’ve selected a few tplink-lightbulb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leematt / homebridge-tplink-lightbulb / index.js View on Github external
scan () {
    Bulb.scan('IOT.SMARTBULB').on('light', (light) => {
      // Does the bulb support color?
      light.is_color = light._sysinfo.is_color

      var accessory = this.accessories.get(light.deviceId)
      // Initialize a new bulb as an accessory
      if (accessory === undefined) {
        this.addAccessory(light)
      }
      // Reconfigure an existing cached accessory
      else {
        this.log('Lightbulb online: %s [%s]', accessory.displayName, light.deviceId)
        accessory = new TplinkLightbulbAccessory(this.log, accessory)
        this.accessories.set(light.deviceId, accessory)
        accessory.configure(light)
      }
    })

tplink-lightbulb

Control TP-Link smart-home devices from nodejs

MIT
Latest version published 11 months ago

Package Health Score

56 / 100
Full package analysis

Popular tplink-lightbulb functions