From 71ba4bc31cccead8e116eff0a72a8ccdf79945a0 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Mon, 1 Jul 2019 11:09:20 +0200 Subject: [PATCH] Fix api client disconnect handler --- esphome/api/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/api/client.py b/esphome/api/client.py index 34e3b4f3a2..9306064a61 100644 --- a/esphome/api/client.py +++ b/esphome/api/client.py @@ -321,7 +321,7 @@ class APIClient(threading.Thread): self._close_socket() if self.on_disconnect is not None and on_disconnect: - self.on_disconnect() + self.on_disconnect(None) def _check_authenticated(self): if not self._authenticated: @@ -410,7 +410,7 @@ class APIClient(threading.Thread): self._socket = None self._connected = False if self.on_disconnect is not None: - self.on_disconnect() + self.on_disconnect(None) elif isinstance(msg, pb.PingRequest): self._send_message(pb.PingResponse()) elif isinstance(msg, pb.GetTimeRequest):