新homeassistant core升级到新版 2025.3.0后, 加载项bemfa一直提示加载失败,在错误日志里提示“paho-mqtt==1.6.1” 。这是由于bemfa依赖旧版的 paho-mqtt<2.0.0,导致兼容性错误,集成无法加载。

临时解决方法:

\homeassistant\custom_components\bemfa文件夹下
manifest.json中的
"requirements": ["paho-mqtt==1.6.1"]
修改为
"requirements": ["paho-mqtt>=2.0.0"]

mqtt.py中
self._mqttc = mqtt.Client(uid, mqtt.MQTTv311)
修改为
self._mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, client_id=uid, protocol=mqtt.MQTTv311)
保存 重启HA 后生效