Skip to content

Commit

Permalink
Fix bug when config.battery = 0, see #220
Browse files Browse the repository at this point in the history
  • Loading branch information
ebaauw committed Nov 25, 2017
1 parent 7323d8b commit d90c6b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/HueSensor.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ function HueSensor(bridge, id, obj) {
this.service.addOptionalCharacteristic(Characteristic.Daylight);
}
this.service.addOptionalCharacteristic(Characteristic.LastUpdated);
if (this.obj.config.battery) {
if (this.obj.config.battery !== undefined) {
this.batteryService = new Service.BatteryService(this.name);
this.batteryService
.updateCharacteristic(Characteristic.ChargingState, this.hk.charging);
Expand Down

0 comments on commit d90c6b8

Please sign in to comment.