mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Fix mqtt chunk subscribe logging (#118217)
This commit is contained in:
parent
3680d1f8c5
commit
3ebcee9bbb
@ -952,13 +952,14 @@ class MQTT:
|
||||
debug_enabled = _LOGGER.isEnabledFor(logging.DEBUG)
|
||||
|
||||
for chunk in chunked_or_all(subscription_list, MAX_SUBSCRIBES_PER_CALL):
|
||||
result, mid = self._mqttc.subscribe(chunk)
|
||||
chunk_list = list(chunk)
|
||||
|
||||
result, mid = self._mqttc.subscribe(chunk_list)
|
||||
|
||||
if debug_enabled:
|
||||
for topic, qos in subscriptions.items():
|
||||
_LOGGER.debug(
|
||||
"Subscribing to %s, mid: %s, qos: %s", topic, mid, qos
|
||||
)
|
||||
_LOGGER.debug(
|
||||
"Subscribing with mid: %s to topics with qos: %s", mid, chunk_list
|
||||
)
|
||||
self._last_subscribe = time.monotonic()
|
||||
|
||||
await self._async_wait_for_mid_or_raise(mid, result)
|
||||
@ -973,10 +974,13 @@ class MQTT:
|
||||
debug_enabled = _LOGGER.isEnabledFor(logging.DEBUG)
|
||||
|
||||
for chunk in chunked_or_all(topics, MAX_UNSUBSCRIBES_PER_CALL):
|
||||
result, mid = self._mqttc.unsubscribe(chunk)
|
||||
chunk_list = list(chunk)
|
||||
|
||||
result, mid = self._mqttc.unsubscribe(chunk_list)
|
||||
if debug_enabled:
|
||||
for topic in chunk:
|
||||
_LOGGER.debug("Unsubscribing from %s, mid: %s", topic, mid)
|
||||
_LOGGER.debug(
|
||||
"Unsubscribing with mid: %s to topics: %s", mid, chunk_list
|
||||
)
|
||||
|
||||
await self._async_wait_for_mid_or_raise(mid, result)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user