'Initialize the RPi binary sensor.'

def __init__(self, hass, port, name, settle_time, invert_logic):

    self._port = port
    self._name = (name or DEVICE_DEFAULT_NAME)
    self._invert_logic = invert_logic
    self._state = None
    def read_pfio(port):
        'Read    state    from    PFIO.'
        self._state = rpi_pfio.read_input(self._port)
        self.schedule_update_ha_state()
    rpi_pfio.edge_detect(hass, self._port, read_pfio, settle_time)
