Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade python-telegram-bot to 6.0.1 #7704

Merged
merged 1 commit into from
May 22, 2017
Merged

Upgrade python-telegram-bot to 6.0.1 #7704

merged 1 commit into from
May 22, 2017

Conversation

fabaff
Copy link
Member

@fabaff fabaff commented May 22, 2017

6.0.1

  • Add support for User.language_code
  • Fix Message.text_html and Message.text_markdown for messages with emoji

6.0.0

Tested with the following configuration:

telegram_bot:
  platform: polling
  api_key: !secret telegram_api
  allowed_chat_ids:
    - !secret telegram_client

notify:
  - platform: telegram
    name: telegram
    chat_id: !secret telegram_client

Message sent with "Call Service"

{"message": "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!"}

@mention-bot
Copy link

@fabaff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @azogue, @sander76 and @balloob to be potential reviewers.

Copy link
Member

@azogue azogue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I propose a minimal correction when rendering template attributes:

in the _render_template_attr at line 221:

if attribute_templ:
    if not isinstance(attribute_templ, str):
        attribute_templ.hass = hass
        data[attribute] = attribute_templ.async_render()
    else:
        data[attribute] = attribute_templ

When messages come from the notify.telegram platform, they come rendered, so it's failing here with an AttributeError.

This change fixes #7705

@azogue
Copy link
Member

azogue commented May 22, 2017

@fabaff

Also, when testing the changes with the webhooksplatform, I have suffered a pair of TimeOut errors in the setup, when calling to bot.setWebhook. Maybe we should pass a timeout of 10s to be generous there...

On the other hand, I have not encountered any more problems with the new version. With some time I will try to explore the new features of the API.

@fabaff
Copy link
Member Author

fabaff commented May 22, 2017

Your proposed changes for the template rendering are included in #7709.

I don't use webhooks but timeouts are always good to avoid open connections which are waiting for the server.

@fabaff fabaff merged commit 47355ee into home-assistant:dev May 22, 2017
@fabaff fabaff deleted the upgrade-python-telegram-bot branch May 22, 2017 11:56
@balloob balloob mentioned this pull request Jun 2, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Sep 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants