From 77aa2e940d4c9f1088d00fc6f72a65a7cd348cc1 Mon Sep 17 00:00:00 2001 From: Eugenio Panadero Date: Mon, 19 Jun 2017 12:03:58 +0200 Subject: [PATCH] increase timeout for setWebhook to 10s (#8102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an optional extended description… --- homeassistant/components/telegram_bot/webhooks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/telegram_bot/webhooks.py b/homeassistant/components/telegram_bot/webhooks.py index f57c0620644..488fbdfec2b 100644 --- a/homeassistant/components/telegram_bot/webhooks.py +++ b/homeassistant/components/telegram_bot/webhooks.py @@ -6,6 +6,7 @@ https://home-assistant.io/components/telegram_bot.webhooks/ """ import asyncio import datetime as dt +from functools import partial from ipaddress import ip_network import logging @@ -70,7 +71,8 @@ def async_setup_platform(hass, config): return False if current_status and current_status['url'] != handler_url: - result = yield from hass.async_add_job(bot.setWebhook, handler_url) + result = yield from hass.async_add_job( + partial(bot.setWebhook, handler_url, timeout=10)) if result: _LOGGER.info("Set new telegram webhook %s", handler_url) else: