Fires when the server has acknowledged an unsubscribe request.
class MQTTUnsubscribedEventParams(object): @property def topic_filters() -> str: ... @property def response_code() -> int: ... # In class MQTT: @property def on_unsubscribed() -> Callable[[MQTTUnsubscribedEventParams], None]: ... @on_unsubscribed.setter def on_unsubscribed(event_hook: Callable[[MQTTUnsubscribedEventParams], None]) -> None: ...
This event fires when the server has acknowledged an unsubscribe request sent with unsubscribe (that is, unlike the on_subscribed event, this event fires only once for each call to unsubscribe, regardless of how many topic filters are passed to it).
Note that in MQTT 3.1.1, servers do not specify which topic filters a client has been successfully unsubscribed in their acknowledgments. In fact, they will still acknowledge an unsubscribe request even if none of the topic filters included matched existing subscriptions. It is up to the client to keep track of what topics it is subscribed to; the TopicFilters parameter is provided as a convenience, its value simply a copy of the value passed to unsubscribe originally.
Possible values for ResponseCode are:
- 0: Success; The subscription is deleted.
- 17: No subscription existed; No matching Topic Filter is being used by the Client.
- 128: Unspecified error; The unsubscribe could not be completed and the Server either does not wish to reveal the reason or none of the other Reason Codes apply.
- 131: Implementation specific error; The UNSUBSCRIBE is valid but the Server does not accept it.
- 135: Not authorized; The Client is not authorized to unsubscribe.
- 143: Topic Filter invalid; The Topic Filter is correctly formed but is not allowed for this Client.
- 145: Packet Identifier in use; The specified Packet Identifier is already in use.