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

Switched from unmaintained tuyapy to tuyaha #24821

Merged

Conversation

PaulAnnekov
Copy link
Contributor

Description:

After 10 days, access token to Tuya API expires and tuyapy library tries to acquire a new one, but that function calls a broken url. This leads to an error like this:

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='px1.tuyaeu.comhomeassistant', port=443): Max retries exceeded with url: /access.do?grant_type=refresh_token&refresh_token=... (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fade0473748>: Failed to establish a new connection: [Errno -2] Name or service not known'))

I don't know whether Tuya API allows to use expired token, but still this bug should be fixed. As tuyapy maintainer has left the company and there was no reply from tuyasmart@tuya.com for a week, I forked tuyapy. The name of the new library is tuyaha. Version 0.0.1 is already published to pypi and contains fixed code. This PR uses new library.

Related issue: possible fix for #20413

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.

@balloob
Copy link
Member

balloob commented Jun 28, 2019

Let's hold off. I'll contact tuya. I got some emails

@balloob
Copy link
Member

balloob commented Jun 30, 2019

I sent them a message, if they don't respond by Thursday, let's merge this.

@PaulAnnekov
Copy link
Contributor Author

PaulAnnekov commented Jun 30, 2019 via email

@PaulAnnekov
Copy link
Contributor Author

@balloob any news?

@balloob
Copy link
Member

balloob commented Jul 6, 2019

Nope.

@balloob balloob merged commit 97ed7fb into home-assistant:dev Jul 6, 2019
@linlingzi
Copy link

thanks,Can you help me
#24570

@Martinvdm
Copy link

When does this become live?

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Sep 18, 2019
@balloob
Copy link
Member

balloob commented Sep 18, 2019

Already live.

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

Successfully merging this pull request may close these issues.

None yet

5 participants