smart-light-disco

Party mode (or maybe disco mode) for smart lights. Cycle through various colors on an interval

Usage no npm install needed!

<script type="module">
  import smartLightDisco from 'https://cdn.skypack.dev/smart-light-disco';
</script>

README

Party Mode For Smart Lights*

Bulbs supported:

  • Kasa KL130

Planned support:

  • A19 C by GE
  • Only a select few smart bulbs are supported due to access to these bulbs

How to use

npm install smart-light-disco

const { Client } = require('tplink-smarthome-api');
const BulbWrapper = require('smart-light-disco');

const client = new Client();

(async () => {
  const device = await client.getDevice({ host: '192.168.254.35' })

  const isOn = await device.getPowerState()

  if (!isOn) {
    await device.togglePowerState()
  }

  // pass in the device
  const bulb = new BulbWrapper(device)

  // fire up disco
  bulb.startDisco(750)
})()