Skip to content

Commit

Permalink
Issue #28
Browse files Browse the repository at this point in the history
Expose on/off plugs as Switch instead of Lightbulb.
  • Loading branch information
ebaauw committed Dec 13, 2016
1 parent 032ec83 commit 6c1ce67
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/HueLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,11 @@ function HueLight(bridge, id, obj, type) {
.setCharacteristic(Characteristic.Manufacturer, zigbee ? obj.manufacturername : "homebridge-hue")
.setCharacteristic(Characteristic.Model, zigbee ? obj.modelid : obj.type)
.setCharacteristic(Characteristic.SerialNumber, this.uuid_base);
this.service = new Service.Lightbulb(this.name);
if (this.state.bri === undefined && this.state.ct === undefined && this.state.xy === undefined) {
this.service = new Service.Switch(this.name);
} else {
this.service = new Service.Lightbulb(this.name);
}
this.service.setCharacteristic(Characteristic.On, this.hk.on);
this.service.getCharacteristic(Characteristic.On)
.on("get", function(callback) {callback(null, this.hk.on);}.bind(this))
Expand Down

0 comments on commit 6c1ce67

Please sign in to comment.