Fix mqtt subscribe debouncer initial delay too long when birth message is disabled (#92188)

Fix mqtt subscribe deboucer initial delay
This commit is contained in:
Jan Bouwhuis 2023-04-28 18:56:22 +02:00 committed by GitHub
parent f8f7de5d5a
commit cff7829a8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View file

@ -740,6 +740,9 @@ class MQTT:
asyncio.run_coroutine_threadsafe(
publish_birth_message(birth_message), self.hass.loop
)
else:
# Update subscribe cooldown period to a shorter time
self._subscribe_debouncer.set_timeout(SUBSCRIBE_COOLDOWN)
async def _async_resubscribe(self) -> None:
"""Resubscribe on reconnect."""