From 6ddbb4d568c001b6559b320b474ab998d5844aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Br=C3=A6dstrup?= Date: Tue, 29 Nov 2016 17:40:51 +0100 Subject: [PATCH] Improved exception handling for D-Link switch (#4633) --- homeassistant/components/switch/dlink.py | 4 ++-- requirements_all.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/switch/dlink.py b/homeassistant/components/switch/dlink.py index 6a00fe71f20..3e1f7db3ddb 100644 --- a/homeassistant/components/switch/dlink.py +++ b/homeassistant/components/switch/dlink.py @@ -15,7 +15,7 @@ import homeassistant.helpers.config_validation as cv from homeassistant.const import TEMP_CELSIUS, STATE_UNKNOWN REQUIREMENTS = ['https://github.com/LinuxChristian/pyW215/archive/' - 'v0.3.6.zip#pyW215==0.3.6'] + 'v0.3.7.zip#pyW215==0.3.7'] _LOGGER = logging.getLogger(__name__) @@ -78,7 +78,7 @@ class SmartPlugSwitch(SwitchDevice): TEMP_CELSIUS) temperature = "%i %s" % \ (ui_temp, self.units.temperature_unit) - except ValueError: + except (ValueError, TypeError): temperature = STATE_UNKNOWN try: diff --git a/requirements_all.txt b/requirements_all.txt index bf8340e1239..cfddeefb83b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -170,7 +170,7 @@ https://github.com/Danielhiversen/flux_led/archive/0.9.zip#flux_led==0.9 https://github.com/GadgetReactor/pyHS100/archive/1f771b7d8090a91c6a58931532e42730b021cbde.zip#pyHS100==0.2.0 # homeassistant.components.switch.dlink -https://github.com/LinuxChristian/pyW215/archive/v0.3.6.zip#pyW215==0.3.6 +https://github.com/LinuxChristian/pyW215/archive/v0.3.7.zip#pyW215==0.3.7 # homeassistant.components.media_player.webostv # homeassistant.components.notify.webostv