Fix improper closing in config flow (#237)

Forgot to add an await to the close method in pytuya when validating the
device. This results in the connection never being closed after adding a
device, giving "connection resets" until the connection fails, the
device or Home Assistant is restarted.
This commit is contained in:
Pierre Ståhl
2020-12-15 10:56:45 +01:00
committed by GitHub
parent e7d58be91c
commit aeb27a4d75

View File

@@ -177,7 +177,7 @@ async def validate_input(hass: core.HomeAssistant, data):
raise InvalidAuth
finally:
if interface:
interface.close()
await interface.close()
# Indicate an error if no datapoints found as the rest of the flow
# won't work in this case