INNER CODE UNIT · Python
on_subscribe
sabuhish/fastapi-mqtt · fastapi_mqtt/handlers.py:29
def on_subscribe(self, handler: MQTTSubscriptionHandler) -> MQTTSubscriptionHandler:
"""
Decorator method is used to obtain subscribed topics and properties.
"""
self._logger.info("on_subscribe handler accepted")
self.client.on_subscribe = handler
return handler
def on_disconnect(self, handler: MQTTDisconnectHandler) -> MQTTDisconnectHandler:
self.client.on_disconnect = handler
return handler
def on_connect(self, handler: MQTTConnectionHandler) -> MQTTConnectionHandler:
self._logger.info("on_connect handler accepted")
self.user_connect_handler = handler
return handler
# TODO: Remove these unused properties on v3.0