UNPKG

homebridge-vesync-v2

Version:

A Homebridge plugin for controlling VeSync smart devices including outlets, air purifiers, and humidifiers

15 lines (12 loc) 518 B
"use strict"; const BaseDevice = require('./BaseDevice'); class LightbulbDevice extends BaseDevice { configureService() { const service = this.accessory.getService(this.Service.Lightbulb) || this.accessory.addService(this.Service.Lightbulb, this.accessory.context.name); service.getCharacteristic(this.Characteristic.On) .on('get', this.getPowerState.bind(this)) .on('set', this.setPowerState.bind(this)); } } module.exports = LightbulbDevice;