Fired immediately after a connection completes (or fails).
class MQTTConnectedEventParams(object): @property def status_code() -> int: ... @property def description() -> str: ... # In class MQTT: @property def on_connected() -> Callable[[MQTTConnectedEventParams], None]: ... @on_connected.setter def on_connected(event_hook: Callable[[MQTTConnectedEventParams], None]) -> None: ...
If the connection is made normally, StatusCode is 0 and Description is "OK".
If the connection fails, StatusCode has the error code returned by the TCP/IP stack. Description contains a description of this code. The value of StatusCode is equal to the value of the error.
Please refer to the Error Codes section for more information.