Open Mips2648 opened 7 months ago
Since version 2.0, as argument "callback_api_version" is require, calling client.reinitialise() raise RuntimeError: Unsupported callback API version because this method do not provide it
current code:
def reinitialise( self, client_id: str = "", clean_session: bool = True, userdata: Any = None, ) -> None: self._reset_sockets() self.__init__(client_id, clean_session, userdata) # type: ignore[misc]
I suppose this could be changed to
self.__init__(self._callback_api_version, client_id, clean_session, userdata) # type: ignore[misc]
Simply init a client then call reinitialise()
reinitialise()
mqtt_client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2) mqtt_client.username_pw_set(username="user", password="pass") mqtt_client.connect(...) mqtt_client.loop_start() ... mqtt_client.reinitialise()
The API break was so wide-impact it broke its own codebase? Oof.
Bug Description
Since version 2.0, as argument "callback_api_version" is require, calling client.reinitialise() raise RuntimeError: Unsupported callback API version because this method do not provide it
current code:
I suppose this could be changed to
Reproduction
Simply init a client then call
reinitialise()
Environment