mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Not need to raise exception
This commit is contained in:
parent
e45ef0013b
commit
1bebb17e9f
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user