'Register the callback handler.'

def _setup_tellcore_callback(self, hass, tellcore_lib):

    callback_id = tellcore_lib.register_device_event(self._tellcore_event_callback)
    def clean_up_callback(event):
        'Unregister    the    callback    bindings.'
        if (callback_id is not None):
            tellcore_lib.unregister_callback(callback_id)
            _LOGGER.debug('Tellstick    callback    unregistered')
    hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, clean_up_callback)
