From 8e4088e08f18edf2d375d339032ea2a3ba69f93f Mon Sep 17 00:00:00 2001 From: Timo Christeleit Date: Wed, 8 Jan 2025 11:03:17 +0100 Subject: [PATCH 1/2] fix tapo h200 + d230 doorbell stream --- pkg/tapo/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tapo/client.go b/pkg/tapo/client.go index 6ccafe4e..78bf5fce 100644 --- a/pkg/tapo/client.go +++ b/pkg/tapo/client.go @@ -291,7 +291,7 @@ func dial(req *http.Request, brand, username, password string) (net.Conn, *http. if err != nil { return nil, nil, err } - _ = res.Body.Close() // ignore response body + _, _ = io.Copy(io.Discard, res.Body) // ignore response body auth := res.Header.Get("WWW-Authenticate") From 2ca97a42c5769f57c0605ba433701d8bf4f43eff Mon Sep 17 00:00:00 2001 From: Timo Christeleit Date: Thu, 9 Jan 2025 09:44:23 +0100 Subject: [PATCH 2/2] Update pkg/tapo/client.go Co-authored-by: Sergey Vilgelm <523825+SVilgelm@users.noreply.github.com> --- pkg/tapo/client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tapo/client.go b/pkg/tapo/client.go index 78bf5fce..c19267ff 100644 --- a/pkg/tapo/client.go +++ b/pkg/tapo/client.go @@ -291,7 +291,8 @@ func dial(req *http.Request, brand, username, password string) (net.Conn, *http. if err != nil { return nil, nil, err } - _, _ = io.Copy(io.Discard, res.Body) // ignore response body + _, _ = io.Copy(io.Discard, res.Body) // discard leftovers + _ = res.Body.Close() // ignore response body auth := res.Header.Get("WWW-Authenticate")