Commit ef1804ba authored by Peter Müller's avatar Peter Müller

Log input/output init errors, v1.0.5

parent d07b5863
Pipeline #227 failed with stage
in 20 seconds
## v1.0.5 2018-12-14
- Log input/output init errors
## v1.0.4 2017-06-10
- New setup promise chain to avoid overlapping initialisations and unhandled rejection errors
......
......@@ -26,7 +26,7 @@
"pcf8574.coffee",
"README.md"
],
"version": "1.0.4",
"version": "1.0.5",
"homepage": "https://git.cryhost.de/crycode/pimatic-pcf8574",
"license": "GPL-2.0",
"repository": {
......
......@@ -166,8 +166,9 @@ module.exports = (env) ->
.then( =>
env.logger.debug "#{@id} input pin initialized"
)
.catch( =>
.catch((err) =>
env.logger.error "Error setting pin as input (device: #{@id}, pcf8574ic: #{@pcf8574ic.id}, pin: #{@config.pinNumber})"
env.logger.error err
)
super()
......@@ -211,8 +212,9 @@ module.exports = (env) ->
.then( =>
env.logger.debug "#{@id} input pin initialized"
)
.catch( =>
.catch((err) =>
env.logger.error "Error setting pin as input (device: #{@id}, pcf8574ic: #{@pcf8574ic.id}, pin: #{@config.pinNumber})"
env.logger.error err
)
super()
......@@ -249,8 +251,9 @@ module.exports = (env) ->
.then( =>
env.logger.debug "#{@id} output pin initialized"
)
.catch( =>
.catch((err) =>
env.logger.error "Error setting pin as output (device: #{@id}, pcf8574ic: #{@pcf8574ic.id}, pin: #{@config.pinNumber})"
env.logger.error err
)
super()
......@@ -306,8 +309,9 @@ module.exports = (env) ->
.then( =>
env.logger.debug "#{@id} output pin for up direction initialized"
)
.catch(=>
.catch((err) =>
env.logger.error "Error setting pin as output for up direction (device: #{@id}, pcf8574ic: #{@up_pcf8574ic.id}, pin: #{@config.up_pinNumber})"
env.logger.error err
)
@down_pcf8574ic.setupChain = @down_pcf8574ic.setupChain.then( =>
@down_pcf8574ic.ic.outputPin @config.down_pinNumber, @config.down_inverted? or false, false
......@@ -315,8 +319,9 @@ module.exports = (env) ->
.then( =>
env.logger.debug "#{@id} output pin for down direction initialized"
)
.catch( =>
.catch((err) =>
env.logger.error "Error setting pin as output for down direction (device: #{@id}, pcf8574ic: #{@down_pcf8574ic.id}, pin: #{@config.down_pinNumber})"
env.logger.error err
)
super()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment