       @debug = @plugin.debug || false
       @base = commons.base @, @config.class
       @candidateInfoHandler = (info) =>
-        if not @timer? and info.mac is @macAddress
-          @base.debug "Amazon dash button triggered (#{info.mac})"
-          @_setContact not @_invert
-          clearTimeout @timer if @timer?
-          @timer = setTimeout( =>
-            @_setContact @_invert
-            @timer = null
-          , @config.holdTime
-          )
+        @trigger() if info.mac is @macAddress
       super()
       @plugin.on 'candidateInfo', @candidateInfoHandler
 


    getContact: () -> Promise.resolve @_contact

  # ###Finally
  # Create a instance of my plugin
  # and return it to the framework.



  class AmazingDashButton extends env.devices.ContactSensor
    actions:
      trigger:
        description: "Closes the contact for the configured holdTime. Called when the dash button has been triggered"

    @prepareConfig: (config) =>
      address = (config.macAddress || '').replace /\W/g, ''
