Skip to content

Commit

Permalink
Catch wrong credential
Browse files Browse the repository at this point in the history
  • Loading branch information
ollo69 committed Apr 27, 2020
1 parent 0742363 commit 7fb797d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion homeassistant/components/tuya/__init__.py
Expand Up @@ -2,7 +2,7 @@
from datetime import timedelta
import logging

from tuyaha import TuyaApi, TuyaNetException, TuyaServerException
from tuyaha import TuyaApi, TuyaAPIException, TuyaNetException, TuyaServerException
import voluptuous as vol

from homeassistant.const import CONF_PASSWORD, CONF_PLATFORM, CONF_USERNAME
Expand Down Expand Up @@ -83,6 +83,13 @@ def retry_setup(now):

return True

except TuyaAPIException as ex:
_LOGGER.error(
"Connection error during integration setup. Error: %s",
str(ex),
)
return False

hass.data[DATA_TUYA] = tuya
hass.data[DOMAIN] = {"entities": {}}

Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -2062,7 +2062,7 @@ tp-connected==0.0.4
transmissionrpc==0.11

# homeassistant.components.tuya
tuyaha==0.0.5
tuyaha==0.0.6

# homeassistant.components.twentemilieu
twentemilieu==0.3.0
Expand Down

0 comments on commit 7fb797d

Please sign in to comment.