What am I doing wrong to get Color temperature support for my LB120 blubs?? here is the index.js file
I am unable to change the colors
`'use strict'
const Bulb = require('tplink-lightbulb')
const promiseTimeout = require('promise-timeout')
const promiseRetry = require('promise-retry')
var PlatformAccessory, Service, Characteristic, UUIDGen
module.exports = function (homebridge) {
PlatformAccessory = homebridge.platformAccessory
Service = homebridge.hap.Service
Characteristic = homebridge.hap.Characteristic
UUIDGen = homebridge.hap.uuid
class TplinkLightbulbPlatform {
constructor (log, config, api) {
this.log = log
this.config = config || {}
this.accessories = new Map()
if (api) {
this.api = api
// Scan for bulbs after cached bulbs have been restored
this.api.on('didFinishLaunching', this.scan.bind(this))
}
}
scan () {
Bulb.scan('IOT.SMARTBULB').on('light', (light) => {
// Does the bulb support color?
light.is_color = light._sysinfo.is_color
//Does the light support color temp
light.is_ct = light._sysinfo.light_state.is_variable_color_temp
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)
}
})
What am I doing wrong to get Color temperature support for my LB120 blubs?? here is the index.js file I am unable to change the colors `'use strict' const Bulb = require('tplink-lightbulb') const promiseTimeout = require('promise-timeout') const promiseRetry = require('promise-retry')
var PlatformAccessory, Service, Characteristic, UUIDGen
module.exports = function (homebridge) { PlatformAccessory = homebridge.platformAccessory Service = homebridge.hap.Service Characteristic = homebridge.hap.Characteristic UUIDGen = homebridge.hap.uuid
homebridge.registerPlatform('homebridge-tplink-lightbulb', 'TplinkLightbulb', TplinkLightbulbPlatform, true) }
class TplinkLightbulbPlatform { constructor (log, config, api) { this.log = log this.config = config || {} this.accessories = new Map()
}
scan () { Bulb.scan('IOT.SMARTBULB').on('light', (light) => { // Does the bulb support color? light.is_color = light._sysinfo.is_color //Does the light support color temp light.is_ct = light._sysinfo.light_state.is_variable_color_temp
}
configureAccessory (light) { this.accessories.set(light.context.deviceId, light) }
addAccessory (light) { var platform = this const name = light.name platform.log('Lightbulb added: %s [%s]', name, light.deviceId)
} }
class TplinkLightbulbAccessory { constructor (log, platformAccessory) { this.log = log this.platformAccessory = platformAccessory this.deviceId = platformAccessory.context.deviceId }
// Request info from bulb, retrying if the request times out getInfo (light) { let self = this
}
configure (light) { this.light = light this.log('Configuring:', this.platformAccessory.displayName)
}
refresh (info) { info = info ? Promise.resolve(info) : this.light.info()
} } `