def respond_to_action(action)
      type = action[:type].to_sym
      state = action[:state].to_sym
      actions = []
      if type == :grid
        actions += responses[:"grid#{action[:x]}#{action[:y]}"][state]
        actions += responses[:"grid#{action[:x]}-"][state]
        actions += responses[:"grid-#{action[:y]}"][state]
      end
      actions += responses[type][state]
      actions += responses[:all][state]
      actions.compact.each {|block| block.call(self, action)}
      nil
    rescue Exception => e
      logger.error "error when responding to action #{action.inspect}: #{e.inspect}"
      raise e
    end
def respond_to_action(action)
      type = action[:type].to_sym
      state = action[:state].to_sym
      actions = []
      if type == :grid
        actions += responses[:"grid#{action[:x]}#{action[:y]}"][state]
        actions += responses[:"grid#{action[:x]}-"][state]
        actions += responses[:"grid-#{action[:y]}"][state]
      end
      actions += responses[type][state]
      actions += responses[:all][state]
      actions.compact.each {|block| block.call(self, action)}
      nil
    rescue Exception => e
      logger.error "error when responding to action #{action.inspect}: #{e.inspect}"
      raise e
    end
Reponds to an action by executing all matching responses.

 Parameters:

 [+action+]  hash containing an action from Launchpad::Device.read_pending_actions