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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix telegram_bot #7877

Merged
merged 1 commit into from Jun 3, 2017
Merged

Fix telegram_bot #7877

merged 1 commit into from Jun 3, 2017

Conversation

balloob
Copy link
Member

@balloob balloob commented Jun 3, 2017

Description:

The telegram_bot code was never even able to work 馃槩 . This is bad.

This should probably fix it, I don't use telegram but at least the big mistakes are gone.

No tests so who knows if it works now. Please someone verify that this works.

@mention-bot
Copy link

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

@tchellomello
Copy link
Contributor

tchellomello commented Jun 3, 2017

@balloob I was running some tests on 0.45.1 to migrate from 0.44.2 (busy days here) and I just ran into this problem.

2017-06-03 05:18:53 INFO (MainThread) [homeassistant.setup] Setting up telegram_bot
2017-06-03 05:18:53 ERROR (MainThread) [homeassistant.setup] Error during setup of component telegram_bot
Traceback (most recent call last):
  File "/home/mdemello/devel/home-assistant/homeassistant/setup.py", line 187, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/home/mdemello/devel/home-assistant/homeassistant/components/telegram_bot/__init__.py", line 285, in async_setup
    yield from async_setup_platform(conf.get(CONF_PLATFORM), conf)
AttributeError: 'list' object has no attribute 'get'

Then I checked the pending PRs list to see if someone already tried to fix it and you beat me :) 馃

Using the fix-telegram branch, the service loaded and I was able to send a message via the /dev-service page. I was able to send a message directly to me and to my group chat too.

Good work!!

LGTM! 馃憤

@lwis lwis merged commit 8461cf2 into dev Jun 3, 2017
lwis pushed a commit that referenced this pull request Jun 3, 2017
@MartinHjelmare
Copy link
Member

I think this broke when we changed from component schema to platform schema for the config. This was done after last release, so 0.45.1 was/is working as far as I can tell. Components with platform schema will modify the config into a list of platforms during setup, hence the error seen above.

@azogue
Copy link
Member

azogue commented Jun 3, 2017

@MartinHjelmare, you're right, this was commented in #7294 (comment) but it went unnoticed.

So for some specific user may be a problem, but is easily solved by eliminating the platform hyphen.

In the end it seems it was for most...

As a consolation, the module works very well for me (I have the configuration without hyphens). I use in my home the webhooks platform, with a group chat and 2 more user chats, with multiple interactive messages throughout the day with a lot of HA complex commands, and without incidents.

@sander76
Copy link
Contributor

sander76 commented Jun 3, 2017

@MartinHjelmare @azogue @balloob
I am now on 0.45.1 and can report it is not working. Sometimes messages do come in, sometimes they don't. Don't have a log dump as I am restarting my hass at this moment trying to fix this.

I want to add that having a "telegram", "telegram_bot", "telegram_webhook" and "telegram_polling" component can be pretty confusing. Originally "telegram" was for sending. Webhook and Polling for receiving. Looking at the docs doesn't really make it clearer. (For example, why is telegram_bot mentioned in the telegram notify component ?). Being the original author of webhook and polling I want to help but being faced with problems like above I just don't know what is correct and what is wrong...

Anyway: Piece and keep up the excellent work! Love hass !

@balloob balloob deleted the fix-telegram branch June 4, 2017 01:51
@balloob balloob mentioned this pull request Jun 4, 2017
@balloob balloob mentioned this pull request Jun 16, 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.

None yet

8 participants