Skip to content

Commit

Permalink
revert node14 code features
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 committed Nov 15, 2020
1 parent 510e33b commit de82f10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/device-led.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module.exports = class deviceLED {
this.log = platform.log
this.Service = platform.api.hap.Service
this.Characteristic = platform.api.hap.Characteristic
this.lightService = accessory.getService(this.Service.Lightbulb) ?? accessory.addService(this.Service.Lightbulb)
// this.lightService = accessory.getService(this.Service.Lightbulb) ?? accessory.addService(this.Service.Lightbulb)
this.lightService = accessory.getService(this.Service.Lightbulb) || accessory.addService(this.Service.Lightbulb)
this.lightService
.getCharacteristic(this.Characteristic.On)
.on('set', this.internalOnOffUpdate.bind(this))
Expand Down
3 changes: 2 additions & 1 deletion lib/govee-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module.exports = class goveeHTTP {
throw new Error(helpers.hasProperty(body, 'message') ? body.message : 'An unknown error occured [getDevices()].')
}
const deviceList = []
if (body.data.devices?.length > 0) {
// if (body.data.devices?.length > 0) {
if (body.data.devices && body.data.devices.length > 0)
body.data.devices.forEach(device => deviceList.push(device))
}
return deviceList
Expand Down

0 comments on commit de82f10

Please sign in to comment.