ESPHome: Remove disconnect callbacks after they are done (#69169)

This commit is contained in:
Jesse Hills
2022-04-04 11:12:49 +02:00
committed by Franck Nijhof
parent 9a91a7edf5
commit 90cb9ccde2
@@ -520,6 +520,7 @@ async def _cleanup_instance(
data = domain_data.pop_entry_data(entry)
for disconnect_cb in data.disconnect_callbacks:
disconnect_cb()
data.disconnect_callbacks = []
for cleanup_callback in data.cleanup_callbacks:
cleanup_callback()
await data.client.disconnect()