Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix H200 + D230 Doorbell stream #1543

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cavefire
Copy link

@cavefire cavefire commented Jan 8, 2025

As stated in my issue #1174 streaming the D230 doorbell was not possible.

Running firmware versions:
H200: 1.3.6 Build 20240829 rel.71119
D230: 1.1.17 Build 20240731 rel.53511

This PR is implementing the fix suggested by @aprilmaccydee (as stated in #1174 (comment)). So all credits to them for figuring that out and sharing.

Using "io.Copy" reads the full body before discarding it, while "Body.Close()" only closes the body. I am not quite sure, why that makes a difference, but it does.

@SVilgelm
Copy link

SVilgelm commented Jan 9, 2025

I am not quite sure, why that makes a difference, but it does.

Because it discards the leftovers in the network buffer. It is pretty common practice in go to use io.Copy and then close the body of a request

pkg/tapo/client.go Outdated Show resolved Hide resolved
Co-authored-by: Sergey Vilgelm <[email protected]>
@AlexxIT AlexxIT self-assigned this Jan 9, 2025
@SVilgelm
Copy link

SVilgelm commented Jan 9, 2025

it would be better to refactor all such cases instead of just this one, but can be done in separate PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants