Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
#7 Explicitly calling method with all parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
michbeck100 committed Nov 20, 2015
1 parent d90b6e2 commit 1af6bbd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hap.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module.exports = (env) =>
promise
.then( (value) =>
env.logger.debug("returning value " + value)
if converter
if converter == null
value = converter(value)
env.logger.debug("value converted to " + value)
callback(null, value)
Expand Down Expand Up @@ -154,7 +154,7 @@ module.exports = (env) =>
@getService(Service.Switch)
.getCharacteristic(Characteristic.On)
.on 'get', (callback) =>
this.handleReturnPromise(device.getState(), callback)
this.handleReturnPromise(device.getState(), callback, null)

device.on 'state', (state) =>
env.logger.debug("switch state changed. Notifying iOS devices.")
Expand Down Expand Up @@ -192,7 +192,7 @@ module.exports = (env) =>
@getService(Service.Lightbulb)
.getCharacteristic(Characteristic.Brightness)
.on 'get', (callback) =>
this.handleReturnPromise(device.getDimlevel(), callback)
this.handleReturnPromise(device.getDimlevel(), callback, null)

device.on 'dimlevel', (dimlevel) =>
env.logger.debug("dimlevel changed. Notifying iOS devices.")
Expand Down

0 comments on commit 1af6bbd

Please sign in to comment.