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:
@@ -177,7 +177,7 @@ async def validate_input(hass: core.HomeAssistant, data):
|
|||||||
raise InvalidAuth
|
raise InvalidAuth
|
||||||
finally:
|
finally:
|
||||||
if interface:
|
if interface:
|
||||||
interface.close()
|
await interface.close()
|
||||||
|
|
||||||
# Indicate an error if no datapoints found as the rest of the flow
|
# Indicate an error if no datapoints found as the rest of the flow
|
||||||
# won't work in this case
|
# won't work in this case
|
||||||
|
Reference in New Issue
Block a user