Skip to content

Commit

Permalink
Fixed relay device driver
Browse files Browse the repository at this point in the history
  • Loading branch information
mwittig committed Jan 21, 2016
1 parent 979bb94 commit 3a4d15b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions devices/johnny-five-relay.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = (env) ->
@changeStateTo(@_state)
)
.catch ((error) =>
@_common.rejectWithError null, error
@_base.rejectWithError null, error
)


Expand All @@ -42,14 +42,14 @@ module.exports = (env) ->
try
resolve @relay.isOn
catch e
@_common.rejectWithError reject, e
@_base.rejectWithError reject, e
.catch (error) =>
@_common.rejectWithError reject, error
@_base.rejectWithError reject, error
)


changeStateTo: (newState) ->
@_common.debug "state change requested to: #{newState}"
@_base.debug "state change requested to: #{newState}"
return new Promise( (resolve, reject) =>
@boardHandle.boardReady()
.then =>
Expand All @@ -60,7 +60,7 @@ module.exports = (env) ->
@_setState newState
resolve newState
.catch (error) =>
@_common.rejectWithError reject, error
@_base.rejectWithError reject, error
)


Expand All @@ -69,4 +69,4 @@ module.exports = (env) ->
.then (state) =>
return Promise.resolve state
.catch (error) =>
return @_common.rejectWithError Promise.reject
return @_base.rejectWithError Promise.reject

0 comments on commit 3a4d15b

Please sign in to comment.