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

Cannot Setup Integration #30

Closed
tjsansone opened this issue Apr 22, 2021 · 4 comments · Fixed by #32
Closed

Cannot Setup Integration #30

tjsansone opened this issue Apr 22, 2021 · 4 comments · Fixed by #32

Comments

@tjsansone
Copy link

Repro Steps:

  • Install TryFi integration in HACS, then restart
  • Attempt to add integration but receive error "cannot connect"
  • Log details below:

Logger: homeassistant.util.async_
Source: util/async_.py:131
First occurred: 6:38:46 AM (1 occurrences)
Last logged: 6:38:46 AM

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for tryfi doing I/O at custom_components/tryfi/config_flow.py, line 47: tryfi = PyTryFi(username=data[CONF_USERNAME], password=data[CONF_PASSWORD])

I was able to get past the error by changing line 47 to:

tryfi = await hass.async_add_executor_job(PyTryFi, data[CONF_USERNAME], data[CONF_PASSWORD])

With this change, the TryFi integration adds successfully. However, no entity ever ends up populating.

The issue seems to stem from config_flow.py - like the user input doesn't appear to save properly (update interval, then next time I go back to options and it's back to the default of 10 again). I spent an hour investigating, but I'm still pretty new to Home Assistant.

Let me know if I can help. I really appreciate your efforts on this project and on PyTryFi!

@tjsansone
Copy link
Author

From testing out the PyTryFi module, it seems I am able to log in successfully, but the updates do not return any pets or bases (length = 0). So that explains why the HACS integration isn't working for me.

Anyone else having trouble?

@tjsansone
Copy link
Author

@sbabcock23 - First off, I just want to thank you for putting together these projects! I've been wanting to take my pup's TryFi to the next level ever since I got it and was very glad when I learned of your project via HACS.
Q: Are community contributions welcome?

I have a couple PRs just about ready to go.. Brief synopsis:

Problem came down to PiTryFi structuring queries with invalid syntax. I'm not familiar with the method being employed; while very clever, it's also kind of confusing. Therefore, I recommend using the graphql-python/gql client, since it's very straightforward and saves work.

Aside from that, the only other issue is with the HACS integration config_flow.py - need to change to async and adjust user input save.

Please let me know if you have any thoughts. Cheers!

@sbabcock23
Copy link
Owner

Hi @SANS-1 ,

Thanks for your help already on this issue. I'm all for community contributions. I have limited time right now so any help is much appreciated. I haven't used that library for graphql but I'll take a look at it when I can. Feel free to contribute!

@sup3rm3ga
Copy link

I am having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants