Skip to content
Snippets Groups Projects
Commit 5e492db9 authored by dasos's avatar dasos Committed by Paulus Schoutsen
Browse files

Fix connection check (#4732)

* Fix connection check

* Release instead

* Remove if

* Update hook.py
parent 6d565192
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
return False
finally:
if response is not None:
yield from response.close()
yield from response.release()
try:
token = data['data']['token']
......@@ -72,7 +72,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
return False
finally:
if response is not None:
yield from response.close()
yield from response.release()
yield from async_add_devices(
HookSmartHome(
......@@ -127,7 +127,7 @@ class HookSmartHome(SwitchDevice):
finally:
if response is not None:
yield from response.close()
yield from response.release()
_LOGGER.debug("Got: %s", data)
return data['return_value'] == '1'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment