rf-kasa-controller v4.0.3
rf-kasa-controller
wrapper for kasa api
usage
const kasa = new KasaController({
username: process.env.KASA_USERNAME,
password: process.env.KASA_PASSWORD
})
kasa.toggle("lightName")methods
they are async
.set(lightname, string) set a light to various settings, using NLP
kasa.set("all", "dim warm white").on(lightName) turns a light on (use "all" to turn all active lights off)
.off(lightName) turns a light off (use "all" to turn all active lights off)
.scene([map])
kasa.scene([
["bed", "dim blue"],
["couch", "red"],
["desk", "on"]
]).allOn() turns all active lights on
.allOff() turns all active lights off
.toggle("lightName") toggles light state on and off
.color("lightName", "dim red") sets color of light
.getLights() returns a list of available lights in your account
.findLight("lightName")
.getState("lightName")
.getInfo("lightName")
.getLightIds() returns all active light ids
.color() options
you can use natural language, using keywords
state keywords:
on, off
color keywords:
red, blue, green, yellow, orange, purple, pink, white
brightness keywords:
bright, high, full, max, dim, medium, dark, low
color temperature keywords:
warm, cool, daylight/day
other keywords:
circadian