From 0742363aee00af517c3d55beda315d5c53092e05 Mon Sep 17 00:00:00 2001 From: ollo69 <60491700+ollo69@users.noreply.github.com> Date: Sun, 26 Apr 2020 22:52:18 +0200 Subject: [PATCH] Update tuya library to 0.0.6 - Catch new library exception --- homeassistant/components/tuya/__init__.py | 5 ++--- homeassistant/components/tuya/manifest.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tuya/__init__.py b/homeassistant/components/tuya/__init__.py index 93343cdca92..50205d12869 100644 --- a/homeassistant/components/tuya/__init__.py +++ b/homeassistant/components/tuya/__init__.py @@ -2,8 +2,7 @@ from datetime import timedelta import logging -from requests.exceptions import ConnectionError as RequestsConnectionError -from tuyaha import TuyaApi +from tuyaha import TuyaApi, TuyaNetException, TuyaServerException import voluptuous as vol from homeassistant.const import CONF_PASSWORD, CONF_PLATFORM, CONF_USERNAME @@ -69,7 +68,7 @@ def setup(hass, config, retry_delay=FIRST_RETRY_TIME): try: tuya.init(username, password, country_code, platform) - except RequestsConnectionError: + except (TuyaNetException, TuyaServerException): _LOGGER.warning( "Connection error during integration setup. Will retry in %s seconds", diff --git a/homeassistant/components/tuya/manifest.json b/homeassistant/components/tuya/manifest.json index cd6cb333020..1279f0a2f66 100644 --- a/homeassistant/components/tuya/manifest.json +++ b/homeassistant/components/tuya/manifest.json @@ -2,6 +2,6 @@ "domain": "tuya", "name": "Tuya", "documentation": "https://www.home-assistant.io/integrations/tuya", - "requirements": ["tuyaha==0.0.5"], + "requirements": ["tuyaha==0.0.6"], "codeowners": [] }