Skip to content

Commit

Permalink
Fix initial mqtt subcribe cooldown timeout (#116904)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouwh authored and frenck committed May 6, 2024
1 parent ed6788c commit ab11357
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion homeassistant/components/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
_LOGGER = logging.getLogger(__name__)

DISCOVERY_COOLDOWN = 5
INITIAL_SUBSCRIBE_COOLDOWN = 1.0
INITIAL_SUBSCRIBE_COOLDOWN = 3.0
SUBSCRIBE_COOLDOWN = 0.1
UNSUBSCRIBE_COOLDOWN = 0.1
TIMEOUT_ACK = 10
Expand Down Expand Up @@ -891,6 +891,7 @@ async def _async_resubscribe_and_publish_birth_message(
qos=birth_message.qos,
retain=birth_message.retain,
)
_LOGGER.info("MQTT client initialized, birth message sent")

@callback
def _async_mqtt_on_connect(
Expand Down Expand Up @@ -950,6 +951,7 @@ def _async_mqtt_on_connect(
name="mqtt re-subscribe",
)
self._subscribe_debouncer.set_timeout(SUBSCRIBE_COOLDOWN)
_LOGGER.info("MQTT client initialized")

self._async_connection_result(True)

Expand Down

0 comments on commit ab11357

Please sign in to comment.