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

Tuya fix login problem and add login platform param #16058

Merged
merged 2 commits into from Aug 19, 2018

Conversation

Projects
None yet
5 participants
@huangyupeng
Copy link
Contributor

commented Aug 19, 2018

Description:

  1. add platform param to distinguish accounts from different apps. Default is tuya.
  2. fix a bug which may cause login failed.
  3. add the error reason while login failed.

Related issue (if applicable): fixes #15613

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#6048

Example entry for configuration.yaml (if applicable):

tuya:
  username: phone or email@example.com
  password: accountpassword
  country_code: 1
  platform: 'smart_life' or 'tuya'

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

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

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

@balloob balloob added this to the 0.76.1 milestone Aug 19, 2018

@balloob

This comment has been minimized.

Copy link
Member

commented Aug 19, 2018

Thanks for the quick fix.

@balloob balloob merged commit 21b88f2 into home-assistant:dev Aug 19, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
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.747%
Details

@ghost ghost removed the in progress label Aug 19, 2018

balloob added a commit that referenced this pull request Aug 19, 2018

Tuya fix login problem and add login platform param (#16058)
* add a platform param to distinguish different app's account.

* fix requirements

@balloob balloob referenced this pull request Aug 19, 2018

Merged

0.76.1 #16064

huangyupeng added a commit to huangyupeng/home-assistant.github.io that referenced this pull request Aug 20, 2018

Add platform param
Add platform to distinguish accounts from different apps
The value could be 'tuya' or 'smart_life'. Default is 'tuya'.
related pull request is home-assistant/home-assistant#16058

@huangyupeng huangyupeng referenced this pull request Aug 20, 2018

Merged

Add platform param #6048

2 of 2 tasks complete
@bakerbug

This comment has been minimized.

Copy link

commented Aug 20, 2018

I’m having issues with the Tuya component. All was working well in 0.75.3 and with 0.76.1 I am getting the following exception:

2018-08-20 13:28:24 ERROR (MainThread) [homeassistant.setup] Error during setup of component tuya
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/tuya.py”, line 65, in setup
tuya.init(username, password, country_code, platform)
File “/srv/homeassistant/lib/python3.5/site-packages/tuyapy/tuyaapi.py”, line 44, in init
self.get_access_token()
File “/srv/homeassistant/lib/python3.5/site-packages/tuyapy/tuyaapi.py”, line 68, in get_access_token
raise TuyaAPIException(message)
tuyapy.tuyaapi.TuyaAPIException: Get accesstoken failed. Username or password error!

I have verified that my credentials are valid (they didn’t change since I upgraded). I have also tried adding the new platform option to my tuya config set to both smart_life and tuya. All combinations result in the same exception.

@huangyupeng

This comment has been minimized.

Copy link
Contributor Author

commented Aug 20, 2018

Could you please send me you account name ?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Aug 20, 2018

@bakerbug Please open an issue for this, if you suspect a bug.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Aug 20, 2018

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.