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

Conversation

Projects
None yet
4 participants
@fabaff
Copy link
Member

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

This comment has been minimized.

Copy link

mention-bot commented May 22, 2017

@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.

@azogue
Copy link
Contributor

azogue left a comment

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

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

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.

@azogue

azogue approved these changes May 22, 2017

@fabaff fabaff merged commit 47355ee into home-assistant:dev May 22, 2017

4 checks passed

cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 93.616%
Details
hound No violations found. Woof!

@fabaff fabaff deleted the fabaff:upgrade-python-telegram-bot branch May 22, 2017

@balloob balloob referenced this pull request Jun 2, 2017

Merged

0.46 #7866

@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.
You can’t perform that action at this time.