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

Removed unnecessary getState method

parent 8b4082e8
......@@ -195,21 +195,6 @@ module.exports = (env) ->
destroy: ->
super()
getState: () ->
# delay getState if initialization of this pin isn't done
if @initializing
new Promise (resolve, reject) =>
@on('initialized', initializedListener = () =>
if @_state? then resolve @_state
@_state = @pcf8574ic.ic.getPinValue @config.pinNumber
resolve @_state
@removeListener 'initialized', initializedListener
)
else
if @_state? then Promise.resolve @_state
@_state = @pcf8574ic.ic.getPinValue @config.pinNumber
Promise.resolve @_state
changeStateTo: (state) ->
assert state is on or state is off
......
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