(self, uuid, wait_for_response=True)
Disable notification for a characteristic and de-register the callback.
Disable notification for a characteristic and de-register the callback.
Disable notification for a characteristic and de - register the callback .
def unsubscribe(self, uuid, wait_for_response=True):
        """
        Disable notification for a characteristic and de-register the callback.
        """
        value_handle, characteristic_config_handle = (
            self._notification_handles(uuid)
        )

        properties = bytearray([0x0, 0x0])

        with self._lock:
            if uuid in self._subscribed_uuids:
                del(self._subscribed_uuids[uuid])
            if value_handle in self._callbacks:
                del(self._callbacks[value_handle])
            if value_handle in self._subscribed_handlers:
                del(self._subscribed_handlers[value_handle])
                self.char_write_handle(
                    characteristic_config_handle,
                    properties,
                    wait_for_response=wait_for_response
                )
                log.info("Unsubscribed from uuid=%s", uuid)
            else:
                log.debug("Already unsubscribed from uuid=%s", uuid)
def unsubscribe ( self , uuid , wait_for_response = True ) : value_handle , characteristic_config_handle = ( self . _notification_handles ( uuid ) ) properties = bytearray ( [ 0x0 , 0x0 ] ) with self . _lock : if uuid in self . _subscribed_uuids : del ( self . _subscribed_uuids [ uuid ] ) if value_handle in self . _callbacks : del ( self . _callbacks [ value_handle ] ) if value_handle in self . _subscribed_handlers : del ( self . _subscribed_handlers [ value_handle ] ) self . char_write_handle ( characteristic_config_handle , properties , wait_for_response = wait_for_response ) log . info ( "Unsubscribed from uuid=%s" , uuid ) else : log . debug ( "Already unsubscribed from uuid=%s" , uuid )