* Add `name` var to BytesIO content to get recognized
Sometimes the python-telegram-bot doesn't recognize the mimetype of the file and looks after a name variable to deduce it. Fixes#7413
* bytesio stream recycle less explicit
* fix double template rendering when messages come from notify.telegram
* fix 'chat' information not present in callback queries
* better inline keyboards with yaml
To make a row of InlineKeyboardButtons you pass:
- a list of tuples like: `[(text_b1, data_callback_b1), (text_b2, data_callback_b2), ...]
- a string like: `/cmd1, /cmd2, /cmd3`
- or a string like: `text_b1:/cmd1, text_b2:/cmd2`
Example:
```yaml
data:
message: 'TV is off'
disable_notification: true
inline_keyboard:
- TV ON:/service_call switch.turn_on switch.tv, Other:/othercmd
- /help, /init
```
* fix send file to multiple targets
* fix message templating, multiple file targets, HA cameras
- Allow templating for caption, url, file, longitude and latitude fields
- Fix send a file to multiple targets
- Load data with some retrying for HA cameras, which return 500 one or two times sometimes (generic cams, always!).
- Doc in services for new inline keyboards yaml syntax: `Text button:/command`
* HttpDigest authentication as proposed in #7396
* review changes
- Don't use `file` as variable name.
- For loop
- Simplify filter allowed `chat_id`s.
* Don't use `file` as variable name!
* make params outside the while loop
* fix chat_id validation when editing sent messages
* bugfix for Telegram chat_ids
- Negative `chat_id`s for groups.
- Include `chat_id` in event data.
- Handle KeyError when receiving other types of messages, as `new_chat_member` ones, and send them as text.
* unused import
* fix double quote style, fix boolean expr, change warning msg
* mistake
* some more fixes
- fix if condition for msg bad fields.
- return True for a correct but not allowed or not recognized message: if not, the message arrives continuously.
- Allow to receive messages from unauthorized users if they come from authorized groups.
* support for `edited_message`s
- They come as normal messages, except for the 'edited_message' field instead of 'message'.
* telegram_bot and notify.telegram enhancements:
- Receive callback queries and produce `telegram_callback` events.
- Custom reply_markup (keyboard or inline_keyboard) for every type of message (message, photo, location & document).
- `disable_notification`, `disable_web_page_preview`, `reply_to_message_id` and `parse_mode` optional keyword args.
- Line break between title and message fields: `'{}\n{}'.format(title, message)`
- Move Telegram notification services to `telegram_bot` component and forward service calls from the telegram notify service to the telegram component, so now the `notify.telegram` platform depends of `telegram_bot`, and there is no need for `api_key` in the notifier configuration. The notifier calls the new notification services of the bot component:
- telegram_bot/send_message
- telegram_bot/send_photo
- telegram_bot/send_document
- telegram_bot/send_location
- telegram_bot/edit_message
- telegram_bot/edit_caption
- telegram_bot/edit_replymarkup
- telegram_bot/answer_callback_query
- Added descriptions of the new notification services with a services.yaml file.
- CONFIG_SCHEMA instead of PLATFORM_SCHEMA for the `telegram_bot` component, so only one platform is allowed.
- Async component setup.
* telegram_bot and notify.telegram enhancements: change in requirements_all.txt.
* Always register the view if a webhook exists.
* Return True if platform is set up succesfully, False otherwise.
* Remove the webhook when home assistant stops. Webhooks and long
polling are mutually excklusive. If a webhook is left after home
assistant is stopped, a polling telegram bot is unable to be set up,
on next start of home assistant.