Migrate paho-mqtt client to version 2.1.0
This commit is contained in:
parent
e2276458ed
commit
ed66686e08
5 changed files with 9 additions and 11 deletions
|
@ -309,10 +309,11 @@ class MqttClientSetup:
|
|||
if (client_id := config.get(CONF_CLIENT_ID)) is None:
|
||||
# PAHO MQTT relies on the MQTT server to generate random client IDs.
|
||||
# However, that feature is not mandatory so we generate our own.
|
||||
client_id = mqtt.base62(uuid.uuid4().int, padding=22)
|
||||
client_id = mqtt._base62(uuid.uuid4().int, padding=22) # type: ignore[attr-defined]
|
||||
transport: str = config.get(CONF_TRANSPORT, DEFAULT_TRANSPORT)
|
||||
self._client = AsyncMQTTClient(
|
||||
client_id,
|
||||
callback_api_version=mqtt.CallbackAPIVersion.VERSION2,
|
||||
client_id=client_id,
|
||||
protocol=proto,
|
||||
transport=transport,
|
||||
reconnect_on_failure=False,
|
||||
|
@ -1132,13 +1133,10 @@ class MQTT:
|
|||
_mqttc: mqtt.Client,
|
||||
_userdata: None,
|
||||
mid: int,
|
||||
_granted_qos_reason: tuple[int, ...] | mqtt.ReasonCodes | None = None,
|
||||
_properties_reason: mqtt.ReasonCodes | None = None,
|
||||
_reason: mqtt.ReasonCodes | None = None,
|
||||
_properties: mqtt.Properties | None = None,
|
||||
) -> None:
|
||||
"""Publish / Subscribe / Unsubscribe callback."""
|
||||
# The callback signature for on_unsubscribe is different from on_subscribe
|
||||
# see https://github.com/eclipse/paho.mqtt.python/issues/687
|
||||
# properties and reason codes are not used in Home Assistant
|
||||
future = self._async_get_mid_future(mid)
|
||||
if future.done() and (future.cancelled() or future.exception()):
|
||||
# Timed out or cancelled
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/mqtt",
|
||||
"iot_class": "local_push",
|
||||
"quality_scale": "platinum",
|
||||
"requirements": ["paho-mqtt==1.6.1"]
|
||||
"requirements": ["paho-mqtt==2.1.0"]
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ lru-dict==1.3.0
|
|||
mutagen==1.47.0
|
||||
orjson==3.10.6
|
||||
packaging>=23.1
|
||||
paho-mqtt==1.6.1
|
||||
paho-mqtt==2.1.0
|
||||
Pillow==10.3.0
|
||||
pip>=21.3.1
|
||||
psutil-home-assistant==0.0.1
|
||||
|
|
|
@ -1523,7 +1523,7 @@ ovoenergy==2.0.0
|
|||
p1monitor==3.0.1
|
||||
|
||||
# homeassistant.components.mqtt
|
||||
paho-mqtt==1.6.1
|
||||
paho-mqtt==2.1.0
|
||||
|
||||
# homeassistant.components.panasonic_bluray
|
||||
panacotta==0.2
|
||||
|
|
|
@ -1238,7 +1238,7 @@ ovoenergy==2.0.0
|
|||
p1monitor==3.0.1
|
||||
|
||||
# homeassistant.components.mqtt
|
||||
paho-mqtt==1.6.1
|
||||
paho-mqtt==2.1.0
|
||||
|
||||
# homeassistant.components.panasonic_viera
|
||||
panasonic-viera==0.4.2
|
||||
|
|
Loading…
Add table
Reference in a new issue