Not need to raise exception

This commit is contained in:
Fabian Affolter 2015-11-25 18:14:19 +01:00
parent e45ef0013b
commit 1bebb17e9f

View File

@ -72,9 +72,6 @@ class MyStromSwitch(SwitchDevice):
timeout=10)
if request.status_code == 200:
self._state = True
else:
raise requests.exceptions.ConnectionError
except requests.exceptions.ConnectionError:
_LOGGER.error("Can't turn on %s. Is device offline?",
self._resource)
@ -87,9 +84,6 @@ class MyStromSwitch(SwitchDevice):
timeout=10)
if request.status_code == 200:
self._state = False
else:
raise requests.exceptions.ConnectionError
except requests.exceptions.ConnectionError:
_LOGGER.error("Can't turn on %s. Is device offline?",
self._resource)