def METHOD_NAME(self, bcm_pin):
    """
    Callback function from GPIO.add_event_detect() for when an edge is detected
    Write rising (1) or falling (-1) edge to influxdb database
    Trigger any conditionals that match the rising/falling/both edge
    :param bcm_pin: BMC pin of rising/falling edge (required parameter)
    :return: None
    """
    try:
        gpio_state = self.GPIO.input(int(self.gpio_location))
    except:
        self.logger.exception("RPi.GPIO and Raspberry Pi required")
        gpio_state = None
    self.logger.debug("Edge detected on pin {ch}: {state}".format(ch=self.gpio_location, state=gpio_state))
    if gpio_state is not None and time.time() > self.edge_reset_timer:
        self.edge_reset_timer = time.time() + self.switch_reset_period
        if (self.switch_edge == 'rising' or
                (self.switch_edge == 'both' and gpio_state)):
            rising_or_falling = 1  # Rising edge detected
            state_str = 'Rising'
        else:
            rising_or_falling = -1  # Falling edge detected
            state_str = 'Falling'
        write_db = threading.Thread(
            target=write_influxdb_value,
            args=(self.unique_id, measurements_dict[0]['unit'], rising_or_falling,),
            kwargs={'channel': 0,
                    'measure': measurements_dict[0]['measurement'],
                    'timestamp': datetime.datetime.utcnow()})
        write_db.start()
        trigger = db_retrieve_table_daemon(Trigger)
        trigger = trigger.filter(Trigger.trigger_type == 'trigger_edge')
        trigger = trigger.filter(Trigger.measurement == self.unique_id)
        trigger = trigger.filter(Trigger.is_activated.is_(True))
        for each_trigger in trigger.all():
            if each_trigger.METHOD_NAME in ['both', state_str.lower()]:
                now = time.time()
                timestamp = datetime.datetime.fromtimestamp(now).strftime('%Y-%m-%d %H-%M-%S')
                message = "{ts}\n[Trigger {cid} ({cname})] " \
                          "Input {oid} ({name}) {state} edge detected " \
                          "on pin {pin} (BCM)".format(
                                ts=timestamp,
                                cid=each_trigger.id,
                                cname=each_trigger.name,
                                oid=self.unique_id,
                                name=self.input_dev.name,
                                state=state_str,
                                pin=bcm_pin)
                self.logger.debug("Edge: {}".format(message))
                self.control.trigger_all_actions(
                    each_trigger.unique_id, message=message)