2019-02-13 20:21:14 +00:00
|
|
|
"""Support for Telegram bot to send messages only."""
|
2017-06-27 05:22:33 +00:00
|
|
|
import logging
|
|
|
|
|
2019-04-12 21:28:59 +00:00
|
|
|
from . import initialize_bot
|
2017-06-27 05:22:33 +00:00
|
|
|
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
2018-10-01 06:56:50 +00:00
|
|
|
async def async_setup_platform(hass, config):
|
2017-06-27 05:22:33 +00:00
|
|
|
"""Set up the Telegram broadcast platform."""
|
2018-03-07 11:44:07 +00:00
|
|
|
bot = initialize_bot(config)
|
|
|
|
|
2020-10-16 11:29:28 +00:00
|
|
|
bot_config = await hass.async_add_executor_job(bot.getMe)
|
2019-07-31 19:25:30 +00:00
|
|
|
_LOGGER.debug(
|
|
|
|
"Telegram broadcast platform setup with bot %s", bot_config["username"]
|
|
|
|
)
|
2017-06-27 05:22:33 +00:00
|
|
|
return True
|