'Register callbacks.'

@asyncio.coroutine
def async_added_to_hass(self):

    def handle_frame(frame):
        'Handle    an    incoming    frame.\n\n                                                Handle    an    incoming    frame    and    update    our    status    if    it    contains\n                                                information    relating    to    this    device.\n                                                '
        if (not frame_is_relevant(self, frame)):
            return
        sample = frame['samples'].pop()
        pin_name = DIGITAL_PINS[self._config.pin]
        if (pin_name not in sample):
            return
        self._state = self._config.state2bool[sample[pin_name]]
        self.schedule_update_ha_state()
    async_dispatcher_connect(self.hass, SIGNAL_ZIGBEE_FRAME_RECEIVED, handle_frame)
