Open WKTYesq opened 1 month ago
See the migrations doc for info on this. But, in summary:
Expected signature for callback API version 2:
connect_callback(client, userdata, connect_flags, reason_code, properties)
Expected signature for callback API version 1 change with MQTT protocol version:
- For MQTT v3.1 and v3.1.1 it's:
connect_callback(client, userdata, flags, rc)
- For MQTT v5.0 it's:
connect_callback(client, userdata, flags, reason_code, properties)
So you need to update your callbacks when changing the API version.
Note: I only speak English (and have not seen any Chinese responses in this repo).
这个版本是警告,能照样运行,估计后面版本会默认是api2了
我使用pahp-mqtt遇到一个警告,如下所示:
控制台:
这个警告我不知道能不能处理 DeprecationWarning: Callback API version 1 is deprecated, update to latest version client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)
我将client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)修改为client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2)后运行:
求大佬帮忙解决,谢谢