From aeb27a4d7595a58714ca74b1444e8d1a47d3fd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20St=C3=A5hl?= Date: Tue, 15 Dec 2020 10:56:45 +0100 Subject: [PATCH] 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. --- custom_components/localtuya/config_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/localtuya/config_flow.py b/custom_components/localtuya/config_flow.py index fc0c01e..23ac46b 100644 --- a/custom_components/localtuya/config_flow.py +++ b/custom_components/localtuya/config_flow.py @@ -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